Archived

This topic is now archived and is closed to further replies.

Couple o' questions/problems

This topic is 5981 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

number 1) my crosshair is pissing me off! =P mmkay, i have it centered in the screen and make it move with forward backward side/side, but i cant get it to stay in the center of screen no matter what, i want it to like move with the mouse etc, so i was wondering if i could use somthing similar to the, getCursorpos and setCursorpos, heres my current code for the crosshair, void Crosshair() { glBindTexture(GL_TEXTURE_2D, texture[4]); glTranslatef(chx,chy,chz-0.12f); glBegin(GL_QUADS); glColor3f(1.0f,1.0f,1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-0.003f, -0.003f, 0.003f); glTexCoord2f(0.003f, 0.0f); glVertex3f( 0.003f, -0.003f, 0.003f); glTexCoord2f(0.003f, 0.003f); glVertex3f( 0.003f, 0.003f, 0.003f); glTexCoord2f(0.0f, 0.003f); glVertex3f(-0.003f, 0.003f, 0.003f); glEnd(); } as you can see, it wont do any mouse movements... my 2nd question/problem is, i need a good tut on billboarding for my sun/moon im making and finally, is there a better way to make an object orbit arround some x,y,z coords/other objects that translatef... thx 9in advance, dirtypope

Share this post


Link to post
Share on other sites
1/ setup a 2d orthogonal window (info in faq http://www.frii.com/~martz/oglfaq/ ) draw the crosshairs in the middle
2/ nate miller (google) has a demo + info
3/ not really to rotate around a point u must first translate the point to (0,0,0) + then perform the translation. u can do this with a cobination of glTranslate(..) + glRotate or glMultMatrix() or glLoadMatrix. the last 2 require u to do the maths

Share this post


Link to post
Share on other sites
i dont think i set up the 2dortho window correctly, cuz i did it how that page said to draw 2d controlls to a 3d app, and when i did that, my textures all like started mixing and rotating when i moved etc etc, looked like my app was on some strong acid or somthing =P is there any tuts that go more in detail on that subject?

Share this post


Link to post
Share on other sites