Hi all,
In OpenGL, say i have a transformation of a model matrix M, is there anyway in irrlicht engine we can apply it directly to IAnimatedMeshSceneNode? similar with openGL operation glLoadMatrixd(M). Therefore we don't need to put one by one the translation, rotation and scale of the model.
thanks
Tranformation Matrix
This is a quick approach (irrlich 0.6):
in ISceneNode.h add a new protected member variable:
still ISceneNode.h add a new public function:
and in the getRelativeTransformation() function add the following line directly before the return statement:
[/b]
It's not optimized, but still supports setting the translation, rotation and scale one by one. You could also add a bool to indicate that the matrix is set and, if so, directly return the matrix in getRelativeTransformation() ignoring the translation, rotation and scale.
regards,
jox
in ISceneNode.h add a new protected member variable:
Code: Select all
core::matrix4 RelativeTransformation;
Code: Select all
virtual void setTransformationMatrix(const core::matrix4& mat) {
RelativeTransformation = mat;
}
Code: Select all
mat *= RelativeTransformation;
It's not optimized, but still supports setting the translation, rotation and scale one by one. You could also add a bool to indicate that the matrix is set and, if so, directly return the matrix in getRelativeTransformation() ignoring the translation, rotation and scale.
regards,
jox
thx jox for the reply,
i haven't tried it yet, but currently i'm doing it manually (setting one by one), and the models transorm really strangely. Do you know whether the OpenGL Axis is compatible with irrlicht engine axis? say postive Z axis in openGL is also positive Z axis in irrlicht?
thanks again
i haven't tried it yet, but currently i'm doing it manually (setting one by one), and the models transorm really strangely. Do you know whether the OpenGL Axis is compatible with irrlicht engine axis? say postive Z axis in openGL is also positive Z axis in irrlicht?
thanks again
I'm not sure about the OpenGL and Irrlich Z axis.
1. In what manner do the models transorm strangely?
2. Where and how do you get the OpenGL matrices from?
3. If you set things manually do you use matrix4.getRotationDegrees/Radians()? Because it has a bug in V0.6
(http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2234)
Or where do you get the rot, trans, scale from?
Maybe you have to convert the opengl matrices somehow (create a conversion matrix).
jox
1. In what manner do the models transorm strangely?
2. Where and how do you get the OpenGL matrices from?
3. If you set things manually do you use matrix4.getRotationDegrees/Radians()? Because it has a bug in V0.6
(http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2234)
Or where do you get the rot, trans, scale from?
Maybe you have to convert the opengl matrices somehow (create a conversion matrix).
jox