> > 1.- Never move the camera, move the rest of the world. (Fog works! :) > What's the difference? ;)
Nothing but all: GL_MODELVIEW_MATRIX and GL_PROJECTION_MATRIX > I think you should strictly "move the world" only when you move the camera - > so when you apply the screen-to-world coordinate transformation, you don't > need to know at that point what the view matrix is. Otherwise, you'll end > up applying the view matrix transformation twice - which is wasteful. I trust the golden rule at http://sjbaker.org/steve/omniv/projection_abuse.html > > 3.- Save a copy of the model matrix before the target.blit > > 4.- For each target, project target position and then unproject mouse > > coords > > to > > get the coords in its plane. > > Target of what? You'll have to explain this better to me (I'm a newbie > too). I'm not sure what you're trying to accomplish. I draw a 3D cursor over the image, that is far from the screen. (to select it, or 3D paint) Targets are images, with alpha channel. If I touch the image where it is transparent, I go to the next image behind. Or to make a hole in the point where a bullet impacts a image, if it has been shot from the camera position (your eyes), and passes thru the monitor screen exactly by the mouse coords. (projector & infrared laser mouse ;) Snapshot: http://zamora.nabla.net/lab/STX1.png > > Some code for point 4, may be it helps to another newbie. > > ... > > that when I rotate the world, the target coords are not correct. > Actually you need wz as well for the new world coordinates. You got it, thats why Im getting erroneous coords when rotating the cam... scene. I was thinking 2D, because my target images are 2D planes. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
