Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
ecac838d
Commit
ecac838d
authored
Nov 09, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in SimpleQT double click on background restore center of rotation
parent
2effd50f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
include/Utils/Qt/qtgl.h
include/Utils/Qt/qtgl.h
+2
-0
src/Utils/Qt/qtgl.cpp
src/Utils/Qt/qtgl.cpp
+10
-5
No files found.
include/Utils/Qt/qtgl.h
View file @
ecac838d
...
...
@@ -82,6 +82,8 @@ protected:
float
m_obj_sc
;
glm
::
vec3
m_obj_pos
;
glm
::
vec3
m_obj_pos_save
;
float
m_obj_width
;
// width and height of windows
int
W
;
...
...
src/Utils/Qt/qtgl.cpp
View file @
ecac838d
...
...
@@ -69,6 +69,8 @@ void GLWidget::setParamObject(float width, float* pos)
{
m_obj_sc
=
((
FAR_PLANE
/
5.0
f
)
/
foc
)
/
width
;
m_obj_pos
=
glm
::
vec3
(
-
pos
[
0
],
-
pos
[
1
],
-
pos
[
2
]);
m_obj_pos_save
=
glm
::
vec3
(
pos
[
0
],
pos
[
1
],
pos
[
2
]);
m_obj_width
=
width
;
}
void
GLWidget
::
resetCenterOfRotation
(
float
width
,
float
*
pos
)
...
...
@@ -76,13 +78,11 @@ void GLWidget::resetCenterOfRotation(float width, float* pos)
m_cbs
->
trans_x
()
=
0.
;
m_cbs
->
trans_y
()
=
0.
;
m_cbs
->
trans_z
()
=
-
FAR_PLANE
/
5.0
f
;
m_obj_sc
=
((
FAR_PLANE
/
5.0
f
)
/
foc
)
/
width
;
// float Z[3] = { 0.0f, 0.0f, 1.0f };
// axis_to_quat(Z, 0.0f, m_cbs->curquat());
setParamObject
(
width
,
pos
);
m_obj_pos
=
glm
::
vec3
(
-
pos
[
0
],
-
pos
[
1
],
-
pos
[
2
]);
newModel
=
1
;
recalcModelView
();
}
...
...
@@ -261,6 +261,11 @@ void GLWidget::mouseDoubleClickEvent(QMouseEvent* event)
glm
::
vec3
P
=
glm
::
unProject
(
win
,
m_cbs
->
modelViewMatrix
(),
m_cbs
->
projectionMatrix
(),
viewport
);
changeCenterOfRotation
(
P
);
}
else
{
resetCenterOfRotation
(
m_obj_width
,
static_cast
<
float
*>
(
&
m_obj_pos_save
.
x
))
;
updateGL
();
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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