Andy Ross writes: > >Jim Wilson wrote: > > David Megginson wrote: > > > I think what Andy's suggesting is that the panel be part of the > > > model's scene graph. > >Yeah. What he said. :) > > > So am I, but panel isn't moved to a scene graph yet. Now that I think > > about it though, he is still going to need the offsets that the model > > doesn't know about to implement the mouse action. > >Nope; just the matrices. The panel knows that if it runs an airframe >coordinate through teh modelview and projection matrices, it'll get >screen coordinates in the range [-1:1]. Just invert that matrix and >we can go from screen coordinates to airframe, thence to panel >coordinates. It's a little more complicated in practice, but that's >the essence of the problem. The panel certainly doesn't need to know >anything specific about the model or the viewer. It can do it all on >its own, without reference to anything but the OpenGL render state. >Again, that's the point behind scene graph architectures.
and you could probably even use the 'hitlist' mechanism almost as is to do this in an SSG way that would return both the face hit and the position in that face :-) I think it is just a matter of putting the cockpit into SSG and then setting up the apropriate 'ray' to intersect with the 'Model' SceneGraph For the 'adventurous' I believe that the 3D cursor stuff from PPE should be convertable to FGFS too. In any event the applicable matrix stuff is all there in 'src / Viewer / ppeViewer.cxx' for anyone inclined to peek Norman _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
