Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityGML
CityGMLViewer
Commits
b3da6958
Commit
b3da6958
authored
2 years ago
by
Matthias Betz
Browse files
Options
Download
Email Patches
Plain Diff
fix scrolling
invert y rotation
parent
8b2c68c5
main
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/hft/stuttgart/citygml/viewer/Camera.java
+3
-3
src/main/java/de/hft/stuttgart/citygml/viewer/Camera.java
src/main/java/de/hft/stuttgart/citygml/viewer/CityGMLViewer.java
+4
-10
...n/java/de/hft/stuttgart/citygml/viewer/CityGMLViewer.java
with
7 additions
and
13 deletions
+7
-13
src/main/java/de/hft/stuttgart/citygml/viewer/Camera.java
+
3
-
3
View file @
b3da6958
...
...
@@ -71,7 +71,7 @@ public class Camera {
public
void
rotate
(
double
dragDiffX
,
double
dragDiffY
)
{
float
rotationX
=
(
float
)
(-
dragDiffX
/
500
f
);
float
rotationZ
=
(
float
)
(
dragDiffY
/
500
f
);
float
rotationZ
=
(
float
)
(
-
dragDiffY
/
500
f
);
float
tempRotationValue
=
rotateAroundZ
+
rotationZ
;
if
(
tempRotationValue
<
-
Math
.
PI
/
2
+
0.0001
||
tempRotationValue
>
Math
.
PI
/
2
-
0.0001
)
{
// to close to 90 degree, stop rotation
...
...
@@ -94,8 +94,8 @@ public class Camera {
public
void
setDistance
(
float
distance
)
{
this
.
distance
=
distance
;
Vector3f
res
=
new
Vector3f
();
eye
Pos
.
sub
(
center
Pos
,
res
);
res
.
normalize
().
mul
(
distance
);
center
Pos
.
sub
(
eye
Pos
,
res
);
res
.
normalize
().
mul
(
this
.
distance
);
centerPos
.
add
(
res
,
eyePos
);
updateMatrix
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/hft/stuttgart/citygml/viewer/CityGMLViewer.java
+
4
-
10
View file @
b3da6958
...
...
@@ -403,7 +403,7 @@ public class CityGMLViewer {
double
translateZ
=
-
d
;
camera
.
setDistance
((
float
)
translateZ
);
cameraViewDistance
=
(
float
)
longestSide
*
20
f
;
camera
.
rotate
(
0
,
-
300
);
camera
.
rotate
(
0
,
300
);
clearColor
=
MemoryUtil
.
memAllocFloat
(
4
);
clearColor
.
put
(
0
,
0.9411765f
).
put
(
1
,
1
f
).
put
(
2
,
1
f
).
put
(
3
,
1
f
);
...
...
@@ -428,16 +428,10 @@ public class CityGMLViewer {
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
Thread
.
currentThread
().
interrupt
();
}
catch
(
CityGMLContextException
e
)
{
e
.
printStackTrace
();
}
catch
(
CityGMLReadException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
ParserConfigurationException
e
)
{
e
.
printStackTrace
();
}
catch
(
SAXException
e
)
{
showErrorDialog
(
e
.
getClass
().
getSimpleName
()
+
": "
+
e
.
getMessage
());
}
catch
(
CityGMLContextException
|
CityGMLReadException
|
IOException
|
ParserConfigurationException
|
SAXException
e
)
{
e
.
printStackTrace
();
showErrorDialog
(
e
.
getClass
().
getSimpleName
()
+
": "
+
e
.
getMessage
());
}
finally
{
MemoryUtil
.
memFree
(
clearColor
);
MemoryUtil
.
memFree
(
clearDepth
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets