[osg-users] texturing a sphere segment

Robert Osfield robert.osfield at gmail.com
Sat Sep 29 01:01:34 PDT 2007

Hi Slyvain,

To do distortion correction you are best using a multiple pass render
to texture approach as done for sphercial display support now in
osgView::View.  I'm I don't have the available time to teach you how
to go about do your own custom distortion correction so you'll have
learn things from what you can gleen from the web, the OSG sources and
a little bit of initiative at your end.


On 9/28/07, sylvain cormier <sly at sat.qc.ca> wrote:
> Sorry for the confusion,
> I am trying to compensate for the deformation caused by a movie screen
> in the shape of a sphere segment by applying a movie texture to a sphere
> segment.
> if the osgviewer already provides the option of deforming to a spherical
> 3d segment shape, (--panoramic-sd and --3d-sd) I would evidently go for
> that option.
> In the meantime, I found OSG very interesting and fun to work with.
> I have successfully modified the osgmovie example to texture spheres,
> cylinders, anything shapedrawable.
> I then took a spheresegment from osgSim::SphereSegment hoping to avoid
> having to make my own geometry.
> I then took your advice and made a geometry, or array of vertices for
> the shape of a sphere segment.
> I am now trying to apply the texture to my geometry with:
> osg::Vec2Array* texcoords = new osg::Vec2Array(# of vertices);
> ////This is what I was tempted to put, my vertices, but setTexCoordArray
> ///wants osg::Vec2Array* what goes here???
> (*texcoords)[1].set(0.007956,4.999994,-0.000348);//1
> (*texcoords)[9].set(0.007456,4.534,-0.0003345);//9
> etc..
> geometry->setTexCoordArray(0,texcoords);
> thanks!
> Sylvain
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list