Rotation problem

Started by
10 comments, last by Zakwayda 17 years, 7 months ago
hi guys i face a problem here i wana rotate my mesh on X axis then Y axis , but when i do that it only rotates on the last axis so anybody could help me please ??? thanx
Advertisement
Post the code (use [ source ][ /source ] tags to retain formatting).
[ source ]
Barbarian.LoadTrimesh("Data/car1.ASE");
Barbarian.set_Position(0.0,1.0,-5.0);
Barbarian.set_Scale(-1.15,-1.15,-1.15);
Barbarian.set_Rotation(180.0,1.0,0.0,0.0);
Barbarian.set_Rotation(cx,0.0,1.0,0.0);

[ /source ]
Sorry, I should have said to leave the spaces out of the source tags.

Anyway, what you posted doesn't really tell us much. Are you using OpenGL? What does set_Rotation do? Those are the sorts of things we need to know.
yeah im using OpenGL and here`s the code:

void set_Rotation(float angle,float x, float y, float z){	m_vRotation = set_3Dvector(angle,x,y,z);}


is that enough or should i add more code???
set_3DVector is another piece of code you are using that we need to see. Try posting as much code that relates to that task as you can. At some point it should process the OpenGL specific command which should help us identify what is going wrong.
here it`s the set_3dVector function

Vector3D set_3Dvector(const float x,const float y,const float z,const float w){	Vector3D vec;	vec.Vector[0]=x;	vec.Vector[1]=y;	vec.Vector[2]=z;	vec.Vector[3]=w;	return vec;}


so what do you think now??
I can send the project to your e-mail if you want to

From what i can see, the set_Rotation or set_3Dvector method doesn't care about previous rotations so you always get the latest rotation.

I think there should be some adding or multiplying between the two vectors (in the two set_Rotation calls)

hope that helps !
Matt
so can you please type how to the code for multiplying the 2 rotations??

This topic is closed to new replies.

Advertisement