Solved

Posted on 2007-10-01
Medium Priority
281 Views
Hi,

I made a really simple propeller plane model out of a few boxes. I made a simple assembly class so when a transformation is applied to the body, the wings and everything else move with the body in the same motion, it works fine.

I want to make the propeller spin independently of the body. I tried applying a rotation matrix to it but then it gets detached from the body and goes spinning off elsewhere.

How can I write a RotateAboutOwnOriginX() function so the propeller in this case just rotates about its own origin?

Thanks
0
Question by:DJ_AM_Juicebox
• 2

LVL 85

Expert Comment

ID: 19996484
That's equivalent to translating (OwnOrigin) to (0,0,0) then rotating around (0,0,0) then translating (0,0,0) to (OwnOrigin)
0

Author Comment

ID: 19997728
Ozo, how do you translate back to the world origin 0,0,0 though - I mean, the vertex list of my polygon has been modified after many transforms already - how would I know what matrix to apply to get it back to the origin?

The only easy way I can see is for each polygon, maintain a secondary list of vertices which keep track of its original starting position when first created, then every matrix applied just keeps accruing from those starting points - so every transform appears to start from when the model is at the world origin.

Is that right?
0

LVL 85

Expert Comment

ID: 19999308
Do you have a vertex on the rotation axis of the propeller? Just use that point as the offset to (0,0,0)
0

LVL 20

Accepted Solution

ikework earned 2000 total points
ID: 20005371
> The only easy way I can see is for each polygon, maintain a secondary list of vertices which keep track of its original
> starting position when first created, then every matrix applied just keeps accruing from those starting points -
> so every transform appears to start from when the model is at the world origin.

excectly that is done in most applications. at start of each frame the original points, which are never changed, are copied to another buffer and all the transformations in this frame are applied there .. and at the end of the frame those points are rendered .. that is much easier to handle ..
so in the case of your propeller, you can store it as a seperate object, all points are defined relativ to the *spinning point*, which is the local {0,0,0} for that object. do the spinning for it in this frame and translate it to the parent object's point to attach the propeller .. if you have objects like that composed of little objects you can think about a tree representing the whole object. at each node of the tree, i.e. the propeller is a matrix defined to move it to the parents-position and the vertices, which define the object independently in its local-coord-system

ike
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…