1
Support / Rotating multiple objects around a single object or center
« on: March 14, 2018, 04:47:23 am »
I'm struggling with a rotation concept.
I'm trying to rotate objects sequentially around a single point. Similar to each of the hours on a clock.
For example, I have 10 primitives and I want to loop these around a central point.
In opengl I could do something like:
But I can't seem to achieve this through jpctae. From what I understand, all of the rotations/translations are performed at the end. So it isn't possible this way.
I've also tried attaching to a dummy object then rotating that but it's the same result because of the same fact.
Would using matrices solve this? Combinig the translation and rotations?
I'm trying to rotate objects sequentially around a single point. Similar to each of the hours on a clock.
For example, I have 10 primitives and I want to loop these around a central point.
In opengl I could do something like:
Code: [Select]
for (int i = 0; i < 10; i++)
{
gl.glPushMatrix();
gl.glRotatef(((float) i / 10) * 361f, 0f, 0f, 1f);
gl.glTranslatef(0, 5f, 0);
clockBar.draw(gl, 0);
gl.glPopMatrix();
}
But I can't seem to achieve this through jpctae. From what I understand, all of the rotations/translations are performed at the end. So it isn't possible this way.
I've also tried attaching to a dummy object then rotating that but it's the same result because of the same fact.
Would using matrices solve this? Combinig the translation and rotations?