What type of marker ? Some kind of geometry or just texture projected on the 
surface ?

I am afraid that first one would be impossible without some intersection 
testing (or depth picking - maybe GL picking could work - but its a guess as 
I am not an expert on GL picking).

Texture marker may be much simpler using texgen and second texture stage for 
marker.

If you are allowed to use shaders you may try to do some procedural fragment 
coloring based on direct screen coords available in fragment shader.

Does this marker needs to adjust to the depth somehow ? If not why you just 
not draw it at your screen location after whole scene was drawn ?

Regards,
Wojtek Lewandowski

PS. Mozesz zaatakowac mnie bezposrednio pod moim adresem po Polsku. Musimy 
sobie pomagac ;-)

----- Original Message ----- 
From: "Janusz Goldasz" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, November 07, 2007 7:38 PM
Subject: [osg-users] marker projection on sphere


> Hello:
>
> I would appreciate any help/advice to direct me in the right direction->
>
> I need to project a marker on a sphere in such a way that its
> coordinates when projected back on the viewport (screen coordinates)
> remain constant regardless camera movements/panning/dragging/pitch
> changes, etc. For a number of reasons this cannot be done using 
> intersector.
>
> The marker has to follow the camera motion "gliding" on the sphere's
> surface in any direction (or a little above it) but the projected
> coordinates should not change and ideally be located in the center of
> the viewport.
>
> If that were done using the intersector the OSG code would be, e.g.:
>
> ---
> if
> (viewer->computeIntersections(ea.getWindowX()+0.5*ea.getWindowWidth(),ea.getWindowY()+0.5*ea.getWindowHeight(),intersections))
>        {
>          const osgUtil::LineSegmentIntersector::Intersection&
> intersection = *(intersections.begin());
>
>          osg::Vec3 markerXYZ = intersection.getWorldIntersectPoint();
> // marker on the sphere
>         .....
> }
>
> Appreciate any guidance/advice,
> Janusz Goldasz
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to