How to make an inventory-like menu...

Started by
10 comments, last by gfaraj 20 years, 3 months ago
quote:Original post by honayboyz
Well hes not talkin about 2d. In opengl i believe that after you load the identity matrix the camera is facing down the Z axis. So in opengl, I render all my scene, load the identity, translate to the xy where i want my menu objects, and render them.

I know dx uses a 3rd matrix so you might have to set the identity in model and view, i dunno.


edit: Search for how to do a fps shooter, rendering the players arms and gun, its the same effect your looking for.

[edited by - honayboyz on January 11, 2004 3:50:53 PM]


Hmm, interesting.. Thanks for the suggestion. I will look for that.


edit: I've searched through gamedev.net and haven't found anything about rendering the player in a FPS game.. Do you know any article on that? Thanks.



[edited by - gfaraj on January 12, 2004 4:22:06 AM]

[edited by - gfaraj on January 12, 2004 4:23:03 AM]
George Faraj,FX LegendsSPS, Honduras
Advertisement
theres not much to do. change to ortho, use something thats independent of your resolution (so dont start using width and height, but values like 1000, that way 500 will always be the center of the screen and all your stuff will be scaled according to the resolution).
disable the z-test (and especially if your menu is transparent, render it after the rest of the scene) and just draw your inventory. either as one big texture to avoid ugly effects of rounding or as single parts (each slot could be a single quad).

i wouldnt worry about not using perspective projection for inventory items. they wont be big and there probably wont be much of a visual difference. even if it is, it might make it stand out which might even be a good thing. else you'll have to do a little math to find out on which vector your object should be to appear in a certain position (really not that hard, w=tan(fov/2) and h=w*aspect are the distance of frustum plane to your line of view at a distance of z=1.. with that its easy to convert between world and screen position).

of course im sure theres an even simpler way including a custom projection matrix ,-)

[edited by - Trienco on January 12, 2004 10:14:03 AM]
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement