Sign in to follow this  
themisomagos

define quad coordinates

Recommended Posts

hello. i am trying to build a little first person shooter game. i am trying to load the target into the terrain so that they gradually rise up from the ground stay on the ground for 10 seconds and get back into the ground if they are not shot. i am loading the target.bmp and projecting it to a quad. first of all i would like to ask how is it possible to define the quads coordinates in which the target will appear.So let's say i want a target to appear in xpos=15.0 zpos=22.0 in my world coordinate system,how can i define that?

Share this post


Link to post
Share on other sites
Define 4 to 6 vertices with texture coordinates and the respective positions.
Bind the image texture.
Draw using GL_QUADS (4 vertices) or GL_TRIANGLES (2x3 = 6 vertices).

You could define the quad once in a display list (e.g. glBegin(GL_QUADS); ... ) and draw the list at every location you want. Just apply some translation/rotation before calling the list.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this