glRotate and glPushMatrix
Posted: Fri Apr 10, 2009 11:56 pm
Hello,
I have trouble in changing OpenGL code to Irrlicht. I don't know how to change the below code to Irrlicht. Would you let me know how to convert OpenGL code to Irrlicht?
for(int i = 1; i < NUM_LINKS; i++)
{
glPushMatrix();
glTranslatef(t[0], t[1], t[2]);
glRotatef(angle, axis[0], axis[1], axis[2]);
glCallList(meshList + i);
glPopMatrix();
}
=> It didn't work. ^^;;;
for(nCnt = 1; nCnt < NUM_LINKS; nCnt++)
{
jointPos = vector3df(t[0], t[1], t[2]);
rot.fromAngleAxis(angle, vector3df(axis[0], axis[1], axis[2]));
rot.toEuler(jointRot);
ptrSceneNode = g_ptrSmgr->getSceneNodeFromId(nCnt);
ptrSceneNode->setPosition(jointPos);
ptrSceneNode->setRotation(jointRot);
}
I have trouble in changing OpenGL code to Irrlicht. I don't know how to change the below code to Irrlicht. Would you let me know how to convert OpenGL code to Irrlicht?
for(int i = 1; i < NUM_LINKS; i++)
{
glPushMatrix();
glTranslatef(t[0], t[1], t[2]);
glRotatef(angle, axis[0], axis[1], axis[2]);
glCallList(meshList + i);
glPopMatrix();
}
=> It didn't work. ^^;;;
for(nCnt = 1; nCnt < NUM_LINKS; nCnt++)
{
jointPos = vector3df(t[0], t[1], t[2]);
rot.fromAngleAxis(angle, vector3df(axis[0], axis[1], axis[2]));
rot.toEuler(jointRot);
ptrSceneNode = g_ptrSmgr->getSceneNodeFromId(nCnt);
ptrSceneNode->setPosition(jointPos);
ptrSceneNode->setRotation(jointRot);
}