Advertisement

Translating Fonts With Viewport

Started by January 06, 2002 09:38 PM
3 comments, last by plates 23 years, 1 month ago
Right, I''ve been basically wondering how you go about causing fonts to be translated when you move your viewport. I''ve completed NeHe''s tutorial on all 3 modes of font mapping, and was hoping to use the first one (bitmap fonts), problem is, when I raster the font in the 3dspace, it dosen''t move with the viewport, only with scene (i.e. if you zoom, fonts position stays static) which would be expected. What I don''t understand is how you bind them to the viewport, as firstly, when I drew them under my glLoadIdentity() statement at the very top of my screen, they just didn''t appear, however if I drew them at the very bottom, they did - Which is what I would expect seeing as they are they would surely need to be the last thing drawn so as not to be obscured by other elements in the scene?. Any help (code specific espeically) greatly appericated. plates.
You say move the viewport. Why are you trying to this?

The viewport simply allows OpenGL to calculated proper perspective mapping in 3D - with the parameters you supply with glFrustum or gluPerspective - or proper orthographic projection in 2D.

Apart from that, I''m not entirely sure what you mean ...
Advertisement
My apologies, I have a camera function which performs movement in the scene, assume I mean that I move the camera - Sorry for the confusion . Basically, if you look at any game, you have usually have a debug mode don't you? which allows you to see values changing in the top left hand of the camera(viewport). If you press the foward key, the values don't dissappear (because they are bound to the camera) - what I want to know, is how do I do that

Edited by - plates on January 6, 2002 10:57:38 PM
You should be using ortho (2D) view rather than perspective (3D) for a start. It sounds to me like you''re applying all tranformations to the text you are trying to draw - You need to reset the ModelView matrix before draw the text.

If you''re using VC6 feel free to mail a .zip to me at

mark.shaxted@btinternet.com

I''ll have a look for you!
step 1: draw everything but the text
step 2: glLoadIdentity();
step 3: draw text

Tada!

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"

This topic is closed to new replies.

Advertisement