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
f9863abf
Commit
f9863abf
authored
6 years ago
by
anikhalder
Browse files
Options
Downloads
Patches
Plain Diff
Change default 3D camera position values
parent
9ae61723
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/ba3d/ba3d/view/canvas.cpp
+10
-5
10 additions, 5 deletions
GUI/ba3d/ba3d/view/canvas.cpp
GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h
+1
-1
1 addition, 1 deletion
GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h
with
11 additions
and
6 deletions
GUI/ba3d/ba3d/view/canvas.cpp
+
10
−
5
View file @
f9863abf
...
...
@@ -41,6 +41,10 @@ float ZoomOutScale()
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
}
namespace
RealSpace
...
...
@@ -266,9 +270,10 @@ void Canvas::defaultView()
{
if
(
model
)
{
// Default view
camera
->
lookAt
(
RealSpace
::
Camera
::
Position
(
RealSpace
::
Vector3D
(
0
,
-
140
,
90
),
// eye
RealSpace
::
Vector3D
(
0
,
0
,
0
),
// center
RealSpace
::
Vector3D
::
_z
));
// up
camera
->
lookAt
(
RealSpace
::
Camera
::
Position
(
RealSpace
::
Vector3D
(
0
,
cameraDefaultPosY
,
cameraDefaultPosZ
),
// eye
RealSpace
::
Vector3D
(
0
,
0
,
0
),
// center
RealSpace
::
Vector3D
::
_z
));
// up
camera
->
endTransform
(
true
);
currentZoomLevel
=
0
;
// reset zoom level to default value
...
...
@@ -280,7 +285,7 @@ void Canvas::sideView()
{
if
(
model
)
{
// Side view at current zoom level
RealSpace
::
Vector3D
eye
(
0
,
-
140
,
0
);
RealSpace
::
Vector3D
eye
(
0
,
cameraDefaultPosY
,
0
);
if
(
currentZoomLevel
>=
0
)
eye
.
y
*=
std
::
pow
(
ZoomInScale
(),
std
::
abs
(
currentZoomLevel
));
...
...
@@ -301,7 +306,7 @@ void Canvas::topView()
if
(
model
)
{
// Top view at current zoom level
// Setting a tiny offset in y value of eye such that eye and up vectors are not parallel
RealSpace
::
Vector3D
eye
(
0
,
-
0.5
,
140
);
RealSpace
::
Vector3D
eye
(
0
,
-
0.5
,
-
cameraDefaultPosY
);
if
(
currentZoomLevel
>=
0
)
eye
.
z
*=
std
::
pow
(
ZoomInScale
(),
std
::
abs
(
currentZoomLevel
));
...
...
This diff is collapsed.
Click to expand it.
GUI/coregui/Views/RealSpaceWidgets/RealSpaceBuilder.h
+
1
−
1
View file @
f9863abf
...
...
@@ -38,7 +38,7 @@ public:
void
populate
(
RealSpaceModel
*
model
,
const
SessionItem
&
item
,
const
SceneGeometry
&
sceneGeometry
,
const
RealSpace
::
Camera
::
Position
&
cameraPosition
=
RealSpace
::
Camera
::
Position
(
RealSpace
::
Vector3D
(
0
,
-
14
0
,
9
0
),
// eye
=
RealSpace
::
Camera
::
Position
(
RealSpace
::
Vector3D
(
0
,
-
20
0
,
12
0
),
// eye
RealSpace
::
Vector3D
(
0
,
0
,
0
),
// center
RealSpace
::
Vector3D
::
_z
));
// up
...
...
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