Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


float Question

This topic is 6103 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

When setting objects such as lights the coordinates are given in float values (ie 1.0f). What exactly does 1.0f = ? example:
struct VERTEX
    float x, y, z;
    float nx, ny, nz; // normals


// and i use VERTEX like this to create a triangle

VERTEX Vertices[] =
    { -2.0f, -2.0f, 0.0f, -1.0f, 0.0f, 0.0f },
    { 2.0f, -2.0f, 0.0f, 1.0f, 0.0f, 0.0f },
    { 0.0f, 2.0f, 0.0f, 0.0f, 1.0f, 0.0f },
When I draw the triangle, its pretty big. So if anyone could explain it to me or point me in a direction I''d appericiate it.

Share this post

Link to post
Share on other sites
1.0f == 1.0f

Seriously, how big your triangle appears depends on where you are looking at it from. The scale itself it entirely arbitrary.

1.0f could be 1 m or 1 AU or even 1 fnord.

Share this post

Link to post
Share on other sites

  • 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!