Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
CGoGN
Commits
0f879a83
Commit
0f879a83
authored
Apr 23, 2013
by
Sylvain Thery
Browse files
Merge branch 'master' of cgogn:CGoGN
parents
5d7f0623
2023e6b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Utils/gl_matrices.h
View file @
0f879a83
...
@@ -70,28 +70,32 @@ public:
...
@@ -70,28 +70,32 @@ public:
void
rotate
(
float
angle
,
const
Geom
::
Vec3f
&
Axis
)
void
rotate
(
float
angle
,
const
Geom
::
Vec3f
&
Axis
)
{
{
m_matrices
[
2
]
=
glm
::
rotate
(
m_matrices
[
2
],
angle
,
glm
::
vec3
(
Axis
[
0
],
Axis
[
1
],
Axis
[
2
]));
glm
::
mat4
X
=
glm
::
rotate
(
m_matrices
[
2
],
angle
,
glm
::
vec3
(
Axis
[
0
],
Axis
[
1
],
Axis
[
2
]))
*
m_matrices
[
2
];
m_matrices
[
2
]
=
X
;
}
}
void
translate
(
const
Geom
::
Vec3f
&
P
)
void
translate
(
const
Geom
::
Vec3f
&
P
)
{
{
m_matrices
[
2
]
=
glm
::
translate
(
m_matrices
[
2
],
glm
::
vec3
(
P
[
0
],
P
[
1
],
P
[
2
]));
glm
::
mat4
X
=
glm
::
translate
(
m_matrices
[
2
],
glm
::
vec3
(
P
[
0
],
P
[
1
],
P
[
2
]))
*
m_matrices
[
2
];
m_matrices
[
2
]
=
X
;
}
}
void
scale
(
const
Geom
::
Vec3f
&
S
)
void
scale
(
const
Geom
::
Vec3f
&
S
)
{
{
m_matrices
[
2
]
=
glm
::
scale
(
m_matrices
[
2
],
glm
::
vec3
(
S
[
0
],
S
[
1
],
S
[
2
]));
glm
::
mat4
X
=
glm
::
scale
(
m_matrices
[
2
],
glm
::
vec3
(
S
[
0
],
S
[
1
],
S
[
2
]))
*
m_matrices
[
2
];
m_matrices
[
2
]
=
X
;
}
}
void
scale
(
float
s
)
void
scale
(
float
s
)
{
{
m_matrices
[
2
]
=
glm
::
scale
(
m_matrices
[
2
],
glm
::
vec3
(
s
,
s
,
s
));
glm
::
mat4
X
=
glm
::
scale
(
m_matrices
[
2
],
glm
::
vec3
(
s
,
s
,
s
))
*
m_matrices
[
2
];
m_matrices
[
2
]
=
X
;
}
}
void
apply
(
const
glm
::
mat4
&
m
)
void
apply
(
const
glm
::
mat4
&
m
)
{
{
m_matrices
[
2
]
=
m
*
m_matrices
[
2
];
glm
::
mat4
X
=
m
*
m_matrices
[
2
];
m_matrices
[
2
]
=
X
;
}
}
};
};
...
...
src/Utils/GLSLShader.cpp
View file @
0f879a83
...
@@ -1123,7 +1123,7 @@ void GLSLShader::updateAllFromGLMatrices()
...
@@ -1123,7 +1123,7 @@ void GLSLShader::updateAllFromGLMatrices()
model
[
i
][
j
]
=
float
(
modelview
[
4
*
i
+
j
]);
model
[
i
][
j
]
=
float
(
modelview
[
4
*
i
+
j
]);
}
}
}
}
model
*
=
currentTransfo
();
model
=
currentTransfo
()
*
model
;
currentPMV
()
=
proj
*
model
;
currentPMV
()
=
proj
*
model
;
currentNormalMatrix
()
=
glm
::
gtx
::
inverse_transpose
::
inverseTranspose
(
model
);
currentNormalMatrix
()
=
glm
::
gtx
::
inverse_transpose
::
inverseTranspose
(
model
);
...
...
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