Jump to content

Translate mouse click coordinates to canvas coordinates


mwpowellhtx
 Share

Recommended Posts

Hello,

I want to convert the coordinates from a mouse click to canvas coordinates. The coordinates generated by jQuery.PEP "pointerdown" event are apparently "world" (browser?) coordinates, they are not canvas coordinates.

I am also using the "hit" testing, which is fine for "selecting" meshes. But now I want to engage the canvas for "missed" hits, and respond to those clicks as well.

Where might there be a "simple" translation I can use that doesn't involve a "positive" hit?

Thank you...

Michael Powell

 

Link to comment
Share on other sites

Clarification: studying the numbers, I'm not sure that the coordinates are "world", but they appear to be at least "canvas". All I know is, they are unreasonable, and definitely not "scene", per se. So I need to convert to scene local from the given scale, whatever that is.

Thanks!

Link to comment
Share on other sites

Thanks for the feedback. Interesting!

I started looking at whether I could coordinate different "kinds" of meshes in my scene in order to gauge fit-for-purpose click hits, which now that I consider it, I believe I could do so, and just key on naming conventions, etc.

I appreciate the feedback though. Helps to sharpen the idea.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...