Surely I will need a lot of math understanding that topics, could you please send more tutorials for understanding that maths and later usign it with irrlicht, I remember when I began my project usign GLUT the behavior of the rotation was very similar to Google Earth and there was a very few algorith besides, why is so dificult with Irrlicht?
This algorith received the x,y mouse position
Code: Select all
void AreaMateria::moverModelo(int x, int y){
if(!false){
alfa = (alfa + (y - y0));
beta = (beta + (x - x0));
x0 = x; y0 = y;
}
else
if(false){
gama = (gama - (x - xz0));
xz0 = x;
gama= (gama - (y - yz0));
yz0=y;
}
glutPostRedisplay();
}
This algorith use the alfa, beta and gama angles for the rotation :
Code: Select all
void AreaMateria::despliega(){
glPushMatrix();
despliegaModelo(fondo,activarnormales);
glPopMatrix();
glPushMatrix();
glBlendFunc ( GL_SRC_ALPHA, GL_ONE );
glEnable(GL_BLEND );
glRotatef(alfa, 1.0f, 0.0f, 0.0f);
glRotatef(beta, 0.0f, 1.0f, 0.0f);
glRotatef(gama, 0.0f, 0.0f, 1.0f);
despliegaModelo(modelo1,activarnormales);
glDisable(GL_BLEND );
glPopMatrix();
}
It will be very useful to undestand quatenions with code examples, thanks
