This topic is now archived and is closed to further replies.

Geometry problem

This topic is 5130 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

I''d like to draw an object which always face the camera. Because my english is not so good, i attached three shots of what i''d like to achieve. As you can see i''d like to render an object (also a simple quad, represented by the orange box) which has the position and orientation shown in the shots. Billboarding wouldn''t do, because i lose one axis.

Share this post

Link to post
Share on other sites
a slightly longer explanation of this:

obviously one axis is already given be the orientation of the plane. for the quad to face the viewer as much as possible its normal has to intersect your view direction. sounds difficult to achieve but its simple. take the crossproduct between your given vector and the vector from quad to camera. now you have two out of three needed vectors. for the last one, do the crossproduct between those two. pretty much like billboarding.

Share this post

Link to post
Share on other sites
some old dx code flying around:
"forward" is the z axis here, meaning the direction the beam is going. "up" is the y axis, "right" is the x axis and the one supposed to face the camera. but which is which depends on how your quad is oriented in your case.

D3DXVec3Cross(&NewUp, &Delta, &Forward);
float length=D3DXVec3Length(&NewUp);
D3DXVec3Cross(&NewRight, &NewUp, &Forward);

Share this post

Link to post
Share on other sites