Jump to content
  • Advertisement
Sign in to follow this  
asafpolt

3d Circle calcalations???

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I've realy hit rock bottom over here. The problem is: I've got a normalized vector and a point. from those two I should be able to get a surface that is vertical to the normalized vector and that contains the point (This should be easy but I dont remember how to do it...). After this was achieved I need to take the point and the surface and use two more things I have: a radius and an angle. I need to take the point and pretend it's the center of a circle (on the surface) whose radius is known, then I need to take the angle and find the relevant point on the circle arc. If you wonder about the angle - where should 0 degrees be located, than you should know it doesn't matter, all that matters that from 0 to 360 a complete circle will be calculated. That is more than I can manage with my humble mind. I would realy appreciate any help. Thanks, Asaf Polturak, Israel

Share this post


Link to post
Share on other sites
Advertisement
It sounds like you need an 'orthonormal basis' function.

To construct a circle in 3-space you need a coordinate system. You already have the origin (the point) and an axis, call it z (the normalized vector). You need to find two additional vectors, x and y, which form an orthonormal basis with z. One way to do this is as follows:

1. Cross z and the world axis with which it is least aligned
2. Normalize the result to get x
3. Cross z and x to get y

You can now simply iterate from 0 to 2pi by some delta. The circle vertices are then of the form:

p + cos(t) * x * r + sin(t) * y * r

Share this post


Link to post
Share on other sites
I didn't understand completly.

first of all to be on the safe side, cross product of two vectors is

(x1,y1,z1) * (x2,y2,z2) = x1*x2 + y1*y2 + z1*z2

Is that correct?

"Cross z and the world axis with which it is least aligned" - what does that mean? what world axis?

thanks

Share this post


Link to post
Share on other sites
Quote:
first of all to be on the safe side, cross product of two vectors is

(x1,y1,z1) * (x2,y2,z2) = x1*x2 + y1*y2 + z1*z2

Is that correct?
That's the dot product. Google 'cross product' to find the correct form.
Quote:
"Cross z and the world axis with which it is least aligned" - what does that mean? what world axis?
By world axis I mean the cardinal basis vectors, (1,0,0), (0,1,0), and (0,0,1). The world axis with which a vector is least aligned is the one that it is 'least parallel to', or alternately 'most perpendicular to'. The least-aligned world axis corresponds to the component of the vector with the smallest absolute value.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!