Jump to content
  • Advertisement
Sign in to follow this  
GKalman

World Coordinates

This topic is 3883 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'm using one of Jack Hoxley's tutorial 3D samples (but NOT with the Fullscreen display, buth rather with a Window display). When I create a, say, Cube object with local coordinates at vertices (1,1,1) ... etc, the Cube is rendered somewhere in the middle of frmMain. Question: How and where is the frmMain's scalewidth (in pixels) defined with respect to the Cube's local coordinates, say, (1,1,1)? In ther words, how and where is the "world-space" scale defined?

Share this post


Link to post
Share on other sites
Advertisement
Yay, someone using my tutorials [grin]


There are many coordinate systems that your data will transition through between creation and rendering. A common path would be Model -> World -> View -> Projection -> Viewport.

Only the latter two (and typically you don't work with the viewport matrix) are directly related to the 2D surface of your form. Projection space is defined in [-1,+1] ranges and is resolution independent (but it's easy enough to go from -1,+1 to 0..pix_width).

The middle of the form will usually be the camera's "look at" coordinate - whatever you've set when creating your view matrix. Although because you're dealing with 3D it's more accurately a ray from the "Look from" (aka "eye") to the "look at" position as any 3D location along that ray will be projected onto the same middle pixel on your 2D form.

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!