On Feb 2, 2008 5:10 PM, Txema Vicente <[EMAIL PROTECTED]> wrote: > > 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 >
Yes, the "golden rule" sounds right too me. I wasn't suggesting you apply the world transformation on the projection matrix. Rather *not* to apply the world transformation on the stack and then later repeat the transformation in your mouse handler. You should only do it strictly once per loop in your app - or each time the "camera" moves. > 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 > You might want to try glReadPixels for this. I would guess that it should give the Z depth right away, so can right away pick the object with the nearest Z value. But I'm not absolutely sure of this - never tried. If it does work, it will definitely simplify your algorithm for selecting the object. Otherwise, it sounds like you're on the right track. -- \\\\\/\"/\\\\\\\\\\\ \\\\/ // //\/\\\\\\\ \\\/ \\// /\ \/\\\\ \\/ /\/ / /\/ /\ \\\ \/ / /\/ /\ /\\\ \\ / /\\\ /\\\ \\\\\/\ \/\\\\\/\\\\\/\\\\\\ d.p.s --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
