This project is read-only.

Rotation issue

Apr 29, 2010 at 10:35 PM

I have one sphere, and i want to rotate it. I can rotate it that by adding angle parameter like in Tutorial2 example.

But, problem is because it is always rotating around (0,0), and i want to move axis of rotation on coordinates i want.

When i translate it in CreateObject () on lets say (10,0), all i get is radius of rotation = 10;

Ball translation in CreateObject():

ballTransNode2.Translation = new Vector3(15, 15, 10);
ballTransParentNode = new TransformNode(); 
kockaTransParentNode.Translation = Vector3.Zero;

Ball rotation in Update():

dxmov += gameTime.ElapsedGameTime.TotalSeconds * rotspeed;
ballTransParentNode.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, (float)(dxmov));
I guess i'm missing something very simple...

Apr 30, 2010 at 1:34 AM

Just assign the point you want the object to rotate around to ballTransParentNode.Translation



May 1, 2010 at 6:30 PM

Heh...i knew it was something obvious...