Jump to content
  • Advertisement
Sign in to follow this  
neilski_2003

Output Position.

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

Now that you guys have helped me solve my random translation and rotation issues i was wondering if any of you could give me any tips as to how i would output data onto the screen. For example i would like to display the x,y and z co-ordinates of the camera so you can see where you are in the world at anyone time. I would presume i need to use fonts to do this but their may be another way so i was wondering if any of you knew of it? Thanks very much for you helpwith everything else guys.

Share this post


Link to post
Share on other sites
Advertisement
best way is to output text on the screen with the needed infos. i would not output to console (if you are under linux) as this slows like hell. you can though also use a seperate window and output there.

ingame text is a topic for itself. look around gamedev, there is a tutorial around somewhere just can't remeber the link [grin].

Share this post


Link to post
Share on other sites
You have a few options. Since you are using glut, the simplest way is to use the glut functions for drawing text. This is pretty slow and you won't have a much control as other approaches, but you can get it working pretty quick, and in a simple project the speed shouldn't be an issue.

The Redbook talks about using bitmap fonts a bit, and NeHe has a tutorial as well I believe.

The general approach I use is to store a font as a texture. Then to draw text, I just switch to ortho mode and draw a quad for each letter using the texture. With a little optimization this is pretty fast, and you can make the letters look like anything you want. You can also modulate the texture with a color to get different colored text. There are also approaches that use a bitmap (as in 1bpp) to do this, but I think the full texture fonts look nicer.

Share this post


Link to post
Share on other sites
well i have managed a very basic HUD design which outputs the camera position in x,y and z as well as some static text such as my name.

However completely off topic i was wondering if anyone had any ideas about moving around inside this 'world'.

At the moment i am using gluLookAt so all i can work out how to do is move the camera along the axis. What i am aiming for is the effect of 'flying' through the field.

This is obviously fine when i only move along the z axis but as soon as i move the camera in the x or y directions i start 'floating' sideways on the z axis.

I suppose really what i need to do then is calculate a new 'forward' direction but i haven't got a scooby doo (clue - for those of you that aren't familiar with us cockney wannabes) how to do that

Once again you lot have proved invaluable so ta very much.

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!