how to make an axis?
#1
Posted 29 September 2003 - 08:49 AM
no matter how my objects move the a xis should stay on the right side with the correct values (my camera is following the objects wherever they go).
i have no idea woh to do it.
any suggestions? :wtf:
#2
Posted 29 September 2003 - 10:16 AM
Use Push and Pop Matrix stacks to prevent changing the original axis :blush:
The Lion King</span>
#3
Posted 29 September 2003 - 11:27 AM
#4
Posted 29 September 2003 - 11:41 AM
The Lion King</span>
#5
Posted 29 September 2003 - 02:58 PM
i am using bitmap fonts to do it ,
is there a way to jump to (0,0,0) from any position?
that way i could use the gltranslatef
#6
Posted 29 September 2003 - 03:40 PM
#7
Posted 29 September 2003 - 05:15 PM
#8
Posted 30 September 2003 - 12:42 AM
urika said:
The Lion King</span>
#9
Posted 30 September 2003 - 07:56 AM
that is exactly my problem , the altitude shows 0 for my object .
i think it is something with push/pop matririx.
checkng that
#10
Posted 30 September 2003 - 08:54 AM
altitude axis : i imagine this to be a HUD that shows your current altitude above the ground. right ?
if this is the case it's easy to render it like this :
select modelview matrix
push matrix
load identity
select projection matrix
push matrix
use glOrtho ( maybe gluOrtho2d instead )
render all HUD elements ( just the altitude bar for you )
pop matrix
select modelview matrix
pop matrix
done
#11
Posted 30 September 2003 - 09:35 AM
i will try and simplify what i am trying to do (i dont know what is a HUD).
1. i built an application that basically follows a jet and a rocket in space , their position and angles are from a file.
2. for each object there is a list of altitude and space position . the lists are fixed on the window and work great.
3. i want to add a list of numbers on the right side of the screen for every y==1000 (untill say 10000).
that means if i am looking at the jet at y=3856 i would see the number 4000 slightly higher than the jet (and to the right)(similar to hi-tech binochulars).
4. what i am trying to do now is to write the numbers in the correct place using bitmap fonts , glTranslatef(x,alt[i],z)--->alt[0]==0,alt[1]==1000...
and glRaster3f(0,0,0).
5. what happens is that i always see 0 at the right side of the screen no matter where i am or what i am looking at.
6. thanks again
#12
Posted 30 September 2003 - 02:24 PM
#13
Posted 30 September 2003 - 03:48 PM
-->each frame it resets the parameters and when i draw the axis it is always 0.
#14
Posted 01 October 2003 - 02:39 PM
1) the y position is absolute -- it represents the altitude and is fixed in space.
2) the x position is according to the camera position which mioves all the time.
i can show either one in the correct place but not both!
im sorry if my problem seems stupid but i just cant fix it :eek:
#15
Posted 01 October 2003 - 02:58 PM
The Lion King</span>
#16
Posted 01 October 2003 - 03:20 PM
#17
Posted 01 October 2003 - 03:47 PM
#18
Posted 04 October 2003 - 07:10 AM
Well I had some heck of a work and less of a time. Working on a game that gives me my salary -).
Btw I had done this once earlier.
Your axis is some sort of a HUD (in case of some games). So I guess you should be really worried about the HUD type of issues. Axis is something that would always be present hence you better use Ortho projects on the model View matrix. For a better illustration you will find the tutorial in www.gametutorial.com
It will have a working code. The tutorial is about a sniper scope kind app.
http://gametutorials.com/Tutorials/OpenGL/.../OpenGL_Pg2.htm
Masking And Ortho Mode
Try it. Only difference is that he draws all the stuff @ the middle of the viewport. You can do that in the bottom : Modify the ModelView matrix - OR -
- Push Matrix
- Transform to the bottom right position
- draw axis (use texture mapping for sizzles and frills. Else good old glColor3f() draw line and so on. (as in 3DS MAx style)
- Pop Matrix. That is all you will need.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












