Determining 3D points on a 3d circle with center and normal vector

Started by
12 comments, last by datadawgx 18 years ago
Hey guys. Here's a funcky question I haven't found a good answer for yet. I have a point in 3d space and a direction vector (basically, a ray). I want to determine a 3d point on the outer edge of the circle for some radius and some theta. I know it's possible, but the math isn't clear to me. Anyone have any clues as to how I can do it?
Advertisement
If you mean circle:

You can always find the edge on the xy-parrelel-plane by adding (sinv, cosv) to the coordinate. You'll have to turn the apropriately if you want it to be on some other plane.

If you mean sphere:

No idea, but you'd need two angles two describe an exact point.
Don't Temp Fate..
right i know how to find values in 2d... i guess i'm trying to figure out how to rotate that circle's plane, like you said, such that the points on the actual circle rotate properly around the circle's center point.

i need to calculate this... cant use transforms. surely someone's done it.
Quote:Original post by datadawgx
i need to calculate this... cant use transforms. surely someone's done it.
The question probably has an easy answer, but perhaps you could clarify what you're after. It sounds like you have a point and a vector, and you want to create points on a circle centered on that point, and lying in a plane whose normal is perpendicular to the vector. Is that right?
Quote:Original post by datadawgx
right i know how to find values in 2d... i guess i'm trying to figure out how to rotate that circle's plane, like you said, such that the points on the actual circle rotate properly around the circle's center point.

Find the normal vector of the plane and rotate it?
Don't Temp Fate..
jyk is on the money. that's exactly what i'm trying to do. any tips?
Quote:Original post by datadawgx
any tips?
It kind of depends on what you're really doing (creating a mesh around a curve of some sort, for example), and what the constraints are. One solution though is to build an arbitrary local coordinate system around the point and the vector, and then use it to construct the vertices of the circle. Ask if you need help with the details (actually, this could probably stand to be in an FAQ somewhere, as it comes up quite often).
i'm not trying to create geometry, per se, but i am looking for vertex-like information (3d points on the circle's arc). i think i understand what you are saying about the local coordinate system... essentially, i'd be picking points from a circle that lies on a plane in 3d space, and then i want to rotate the circle's plane (and the defined points) such that the circle's normal points in the desired direction.

i can't wrap myself around the math. are matrix transforms in inevidable?
This is all you need.

It's about moving cameras around without gimbal lock, but think about it: you want to rotate a vector around another one. Quaternions are (I haven't gotten into them much) fast and easy to use.

Have fun!
Say you have point 'P' which is the centre of your circle and normal 'N'. You can create a random point 'A' that lies on the circle of given radius as follows:

- create a random vector 'V' (e.g. 0.34234, 0.565754, -0.5443) those numbers can be picked randomly. Just make sure the numbers you pick do not result in a null vector or one that is parallel with your vector N, or you will have trouble in the normalisation stage.

- create vector 'R' where: R = crossproduct(N, V)

- normalise(R)

// R is a random vector of unit length lying in the plane defined by normal N

- A = P + R * radius

This topic is closed to new replies.

Advertisement