• Content count

  • Joined

  • Last visited

Community Reputation

103 Neutral

About OnkyDong

  • Rank
  1. ogrekit applyTorque orientation problem

    [quote name='Faelenor' timestamp='1350670820' post='4991854'] What do you want to do exactly, rotate around the local X axis or the world X axis? The torque is in [b]world[/b] coordinates, so what you're seeing seems normal to me. Also, what do you mean by "only the object itself seems to rotate, the orientation of the object seems to stay the same", how can the orientation stay the same if the object rotates? It's also not clear if your images were with or without the rotation in your code snippet. [/quote] Hi thanks for your reply! What i want is to rotate an object around the local X axis. No matter how it's located in the world, it should always rotate the same way. So for example, i have a camera pointing to the side of an object, i rotate the object around it's z axis, after doing that i rotate the object 90 degrees in the world and rotate the object around it's z axis again. I should see the same output. However, this is not the case right now. I am not sure what i'm doing wrong, and how it should be done. There seems to be very little documentation about this.
  2. Hi, I am trying to rotate a 3d object in ogrekit by applying applyTorque(). This works fine when the object orientation is not changed. But for example if i rotate my object 90 degrees to the left, only the object itself seems to rotate, the orientation of the object seems to stay the same. This causes the following problem: If i use applyTorque() while the object is still in it's begin orientation(with up Arrow keyboard button): http://i.imgur.com/e5f24.png If i use applyTorque() while the object is rotated 90 degrees clockwise(with up Arrow keyboard button): http://i.imgur.com/G0CR9.png I tried to use quaternions to change the orientation, but this doesn't seem to do anything. What am i doing wrong? Code: [CODE] gkVector3 speedd, torque; gkQuaternion orientation; orientation = blockObj->getOrientation();//blockObj is the object i'm trying to rotate. gkVector3 newX; if(Buttonpress)){ newX = orientation * gkVector3::UNIT_X; torque -= newX; } blockObj->applyTorque(gkVector3(torque.y, torque.x, torque.z)); torque=0; [/CODE] I hope my explanation/question is understandable. It's hard to explain. thanks.