?
Solved

rotations about local origin

Posted on 2007-10-01
4
Medium Priority
?
281 Views
Last Modified: 2013-12-26
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
Comment
Question by:DJ_AM_Juicebox
  • 2
4 Comments
 
LVL 85

Expert Comment

by:ozo
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

by:DJ_AM_Juicebox
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

by:ozo
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

by:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question