A Flash Developer Resource Site

# Thread: [RESOLVED] 3d rotation, calculating orientation

1. ## [RESOLVED] 3d rotation, calculating orientation

This is kind of complicated, so I'll explain with a visual scenario...

Say that there's a ping-pong ball with a needle sticking out of the top of it.

If you were to rotate the ping pong ball 90 degrees along the X or Z axis, then the needle would be horizontal (or parallel to the plane).

Here's where my brain starts to hurt...

If you rotate all three axises at the same time, how then would you calculate when the needle become horizontal, or passes into the southern hemisphere of the pingopong ball?

2. Okay, I got it figured out.

What I should have mentioned before is that the rotations were calculated from papervision's Matrix3D class.

After a good night's sleep, I realized that all I needed to do was roll the ping-pong ball back to a rotationZ of 0, then I can look that the rotationX to determine which hemisphere the needle is in.

Thanks to anyone who racked their brains over this

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap