Skip to main content
gamedev.net
🔒 Locked

3D world

Started by Neandrake 0 replies 200+ views
Original Post
Neandrake
Neandrake
I''ve been following a few of the tutorials on www.gametutorials.com for opengl and I have a 3d world. Basically for now it consists of five pyramid figures and a grid along the x and z axis and the constant y value is 0. I changed the perspective of the camera so that you are in the positive y region and looking down at the flat grid. I was wondering how to add a mouse for the user to move around. I know you have to make a jpg file and load it at the cursor point, but I''m confused at how to add a 2d mouse in a 3d world and facing a different direction because you''re looking down. I did some searching and found sample code that did some overlaying to add a mouse made from triangles, but there''s something in the code I don''t understand. The sample code is at: http://www.geocities.com/SiliconValley/Lakes/7220/pointer.html I only have two questions. In the BeginOverlay, the gluOrtho2d() function has Engine.h and Engine.w and I don''t know wtf those are. Also, in the EndOverlay() function, shouldn''t it enable everything that was disabled in the BeginOverlay function? Maybe I should go about this another way. Because I want to have the mouse be able to do selections by running a ray from the mouse straight down the y axis and determine if it hit anything(that''s another subject). But I''m still interested in overlaying. What exactly is it? Any help appreciated -chris
TwistedMatrix
TwistedMatrix
I have a VERY limited knowledge of openGL, but I once overlayed 2d functions on 3d in openGL. (I needed a FPS counter to display) I think I rendered the triangles and then switched to orthographic mode and rendered the 2D. I don''t really remember.

- Twisted Matrix
Twisted Matrix

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.