A Flash Developer Resource Site

# Thread: Rotating a 3d Point around A 3D Line

1. ## Rotating a 3d Point around A 3D Line

Line is defined by two 3d points; (0,0,0) and (x,y,z). And there is also this 3d point. How can rotate this 3d point around the line?

Something like this (points indicate vectors in my expression, it's the same thing) :

I found some stuff on the internet but I couldn't really figure it out.

2. Take a look at the point transformation stuff inside five3D - you may be able to do what you want without really getting into the math of it if you nest things.

3. Originally Posted by neznein9
Take a look at the point transformation stuff inside five3D - you may be able to do what you want without really getting into the math of it if you nest things.
I couldn't find anything useful http://five3d.mathieu-badimon.com/docs/as3/

4. You must find matrix which transform axis X (or other axis) to your line and next do following steps:
a) mult by inverse matrix (your line is now X axis)
b) rotate around X axis
c) mult by matrix (X axis is back to your line)

5. Originally Posted by GoldHand
You must find matrix which transform axis X (or other axis) to your line and next do following steps:
a) mult by inverse matrix (your line is now X axis)
b) rotate around X axis
c) mult by matrix (X axis is back to your line)
yes that must be the way but I can't figure it out http://www.euclideanspace.com/maths/...trix/index.htm

6. You should check function which calculates matrix for target camera where camera is point (0,0,0) and target point is point at the end of your line.

7. Originally Posted by GoldHand
You should check function which calculates matrix for target camera where camera is point (0,0,0) and target point is point at the end of your line.
How can I use that matrix?

#### 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