Jump to content

Project & UnProject


SpiderPig
 Share

Recommended Posts

This may be silly but I'm constantly forgetting which function does what when it comes to the camera functions Project() & UnProject().  It might be helpful if the first argument of both commands were renamed to "Vec3 &screen_position" & "Vec3 &world_position" respectively.  That way it be easy to identify what does what! :D

Link to comment
Share on other sites

Yes, I always forget which is which. Maybe these should be ScreenToWorld and WorldToScreen?

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

10 hours ago, SpiderPig said:

Also screen_position should probably be an iVec3 like is returned by window->GetMousePosition(), unless there's a need for it to be Vec3?

z coordinate is the distance in front of the camera.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

6 hours ago, Josh said:

Yes, I always forget which is which. Maybe these should be ScreenToWorld and WorldToScreen?

Yeah, in one of my projects I made a wrapper for them.  I called them CastToScreen and CastToWorld.  Naming them to show what they do will help.

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.

 Share

×
×
  • Create New...