Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
daabc5cf
Commit
daabc5cf
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
mv rotation speed prefactor
parent
e76aa01d
No related branches found
No related tags found
1 merge request
!1089
Img3D: simplify class Canvas
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Img3D/View/Camera.cpp
+2
-8
2 additions, 8 deletions
Img3D/View/Camera.cpp
Img3D/View/Camera.h
+2
-2
2 additions, 2 deletions
Img3D/View/Camera.h
Img3D/View/Canvas.cpp
+3
-6
3 additions, 6 deletions
Img3D/View/Canvas.cpp
with
7 additions
and
16 deletions
Img3D/View/Camera.cpp
+
2
−
8
View file @
daabc5cf
...
...
@@ -98,11 +98,8 @@ void Camera::endTransform(bool keep)
set
();
}
void
Camera
::
horizontalTurn
(
float
angle
)
void
Camera
::
horizontalTurn
(
float
theta
)
{
const
float
theta
=
angle
*
static_cast
<
float
>
(
M_PI
/
180.0
);
// in radians
// Horizontal camera turn for 3D axes
const
CameraParams
initial_pos3DAxes
=
getPos3DAxes
();
const
F3
v_eye3DAxes
=
initial_pos3DAxes
.
eye
;
// camera's position vector
...
...
@@ -142,11 +139,8 @@ void Camera::horizontalTurn(float angle)
endTransform
(
true
);
}
void
Camera
::
verticalTurn
(
float
angle
)
void
Camera
::
verticalTurn
(
float
theta
)
{
const
float
theta
=
angle
*
static_cast
<
float
>
(
M_PI
/
180.0
);
// in radians
// Vertical camera turn for 3D axes
const
CameraParams
initial_pos3DAxes
=
getPos3DAxes
();
const
F3
v_eye3DAxes
=
initial_pos3DAxes
.
eye
;
// camera's position vector
...
...
This diff is collapsed.
Click to expand it.
Img3D/View/Camera.h
+
2
−
2
View file @
daabc5cf
...
...
@@ -49,8 +49,8 @@ public:
const
F3
lightPosRotated
()
const
{
return
lightPosRotated1
;
}
// Flying Camera implementation (similar to Blender's camera system)
void
horizontalTurn
(
float
angle
);
void
verticalTurn
(
float
angle
);
void
horizontalTurn
(
float
theta
);
void
verticalTurn
(
float
theta
);
signals
:
void
updated
(
Camera
const
&
);
...
...
This diff is collapsed.
Click to expand it.
Img3D/View/Canvas.cpp
+
3
−
6
View file @
daabc5cf
...
...
@@ -42,9 +42,6 @@ float ZoomOutScale()
return
0.8
f
;
}
const
float
rot_speed_h
=
0.4
f
;
// camera rotation speed in horizontal direction
const
float
rot_speed_v
=
0.4
f
;
// camera rotation speed in vertical direction
// Default camera position in accordance with RealspaceBuilder.h
const
float
cameraDefaultPosY
=
-
200.0
f
;
// default camera position on Y axis
const
float
cameraDefaultPosZ
=
120.0
f
;
// default camera position on Z axis
...
...
@@ -230,11 +227,11 @@ void Canvas::mouseMoveEvent(QMouseEvent* e)
if
(
!
isInitialized
())
break
;
//
-ve
for consistency with Blender
//
minus sign
for consistency with Blender
; arbitrary prefactor for decent rotation speed
if
(
delta_x
!=
0
)
m_camera
->
horizontalTurn
(
-
delta_x
*
rot_speed_h
);
m_camera
->
horizontalTurn
(
-
0.007
f
*
delta_x
);
if
(
delta_y
!=
0
)
m_camera
->
verticalTurn
(
-
delta_y
*
rot_speed_v
);
m_camera
->
verticalTurn
(
-
0.007
f
*
delta_y
);
m_lastMouseCoords
=
e
->
pos
();
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment