Re: [Plib-users] Selecting with mouse
Brought to you by:
sjbaker
From: Curtis L. O. <cu...@me...> - 2002-09-30 14:02:52
|
David, I think step one would be to get a general purpose vector/scene-graph intersection routine in plib. Plib does have something that will intersect a z=up vector with the geometry (for use in finding ground height in a z=up game.) But, there needs to be a more general purpose routine that can find intersections with any arbitrary vector. FlightGear has something close, but it is highly optimized and specialized for the flightgear scenery so it may not work as general purpose drop in to plib. But, once you have such a thing, the it should be relatively straight forward to figure out which vector goes from your eye/camera view point through the near clip plane at the mouse coordinates, and then intersect this vector with the scene graph. You'll likely need to do some post processing of the results to find the particular intersection point of interest, but that would be pretty application specific anyway. Plib does have some sort of "LOS" intersection routine stubbed in, but last time I checked in was completely in-op. That's how my mind works any way, there's probably a much cleverer/quicker way with inverting the camera matrix or something, but I don't feel that matrix-friendly today to even try to think that one through. Regards, Curt. David Megginson writes: > Norman Vine writes: > > > If the PPE source is that 'opaque' then a 'refresher' course in > > the OpenGL 'way' might help > > http://fly.cc.fer.hr/~unreal/theredbook/chapter12.html > > That's not the issue -- I understand (most of) the OpenGL stuff, but I > find the PPE source very difficult to follow. No offence is intended > to the authors; my point is just that "read PPE" isn't particularly > helpful advice either to me or to the others who've posted the same > question. > > I'd like to make two major points: > > 1. The lack of a simple objects-under-the-mouse function in SSG is a > serious gap; i.e. it's a need-to-have, not a want-to-have feature > for a general-purpose scene-graph API. > > 2. I'm not assuming that it's Steve's responsibility to fill that gap, > but would be grateful for more concrete guidance from the plib > development community as a whole. > > Point #1 might not be self-evident to someone like Steve who writes > high-end simulation software that will be used with prebuilt panels > and cockpits, but it's critical for the PC world. It's useful not > only for operating instruments in a flight or racing simulator, but > also for manipulating objects in a modeller, identifying features in a > 3D GIS display, etc. etc. etc. There's no point making each > application writer recreate this code from scratch. > > > All the best, > > > David > > -- > David Megginson, da...@me..., http://www.megginson.com/ > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities cu...@me... cu...@fl... Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org |