Sign in to follow this  
hiS_oWn

Anyone know how to implement this concept?

Recommended Posts

hiS_oWn    122
Lets say you have a model with your standard ZPR (zoom pan rotate) and there is a point on that model you want to track such that there appears a 2-d reticle around it no matter what angle you view the model at (occlusion wanted, but not what I'm having problem with at this point). How would you implement this? Given you know the vertex and the viewing matrix? It's such an easy concept, but I'm having a hard time concentrating enough to remember what I have to do.

Share this post


Link to post
Share on other sites
hiS_oWn    122
In answering my own question, there is a glu function called gluProject which offers many of the requirements of tracking between the 3d and 2d pane.

http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/project.html

Share this post


Link to post
Share on other sites
swiftcoder    18432
Quote:
Original post by hiS_oWn
How would you implement this? Given you know the vertex and the viewing matrix? It's such an easy concept, but I'm having a hard time concentrating enough to remember what I have to do.
You need the model and projection matrices as well. Just multiply your 3d point by the ModelViewProjection matrix, and you get a 2d point in view/clip coordinates - the gluProject function will do this for you.

You can also do this with a billboard. Extract the up and right vectors from the ModelView matrix, and use them to orient a billboard centered on the point. This approach will get you occlusion as well, although the reticule will become smaller with distance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this