Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CGoGN
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