Sign in to follow this  
langtudontinh

How to translate screen coordinate to texture coordiante?

Recommended Posts

langtudontinh    112
I have an image texture displayed on screen, the problem is I want to get mouse input and translate its position to texture coordinate. Just want to draw multi-line on the texture. I greatly appreciate your answer!

Share this post


Link to post
Share on other sites
langtudontinh    112
Thank for your reply.
I understand the formula, but I think you missed my question. I don't know howto map the mouse-clicked position (2D space) to 3D space (the camera placed at any position in world space), then this point will be translated to a texture coordinate.

Share this post


Link to post
Share on other sites
circlesoft    1178
What you are trying to do is commonly referred to as "picking". There are lots of topics floating around here about it (unfortunately, the search has been "Temporarily Disabled" for like a billion freaking days - you can still do a less-effective Google search though).

This may be a helpful topic.
Improved Ray Picking

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