[osg-users] Issue with Model Display in OSG with VR Juggler

Gerrick Bivins gbivins at objectreservoir.com
Thu Jul 3 11:50:24 PDT 2008

Have you tried "normalizing" your normals after scaling?

On 7/3/08 1:36 PM, "Galen Faidley" <gfaidley at gmail.com> wrote:

> Doug,
> Thanks for getting back to Abhishek on this.  I have been working with
> him on the issue as well.
> We had already tried alternate default lights and the custom lighting
> but nothing seemed to help (we also tried them again after your post
> as a sanity check).  However, seeing the working lights in your screen
> shot made us do some more experimentation.  It turns out we were not
> quite using the default osgNav.  We had scaled the model by a factor
> 0.001.  When we removed the scale the lighting behaved as expected.
> We also added the scale to the osg file and the lighting in osgviewer
> looked exactly like what we originally saw in juggler (the files are
> both attached).
> So I guess the question is how do we scale a light or at least get
> equivalently lighting with the scaled model?  I tried a number of
> things: attaching the light below the scale transform, scaling the
> light position, and scaling all the light parameters
> (constant_attenuation, linear_attenuation, etc).  So far none of these
> seem to make a difference.
> We'd appreciate any insight.
> Regards
> Galen
> On Thu, Jul 3, 2008 at 11:26 AM, Doug McCorkle <mccdo at iastate.edu> wrote:
>> On Jul 3, 2008, at 11:06 AM, Abhishek Seth wrote:
>>> Hi !
>>> I am having problems with how models look when loaded in my Application. I
>>> am using OSGNav Sample program from VR Juggler 2.2.1 with OSG 2.4.  Juggler
>>> uses osgUtil::SceneView but does not use osgViewer::.
>>> When I load the file in OsgViewer it looks great; however in Juggler's
>>> OSGNav it looks awful (the colors get washed out). I suspect this is related
>>> to how Juggler is handling the Materials and Lighting while rendering the
>>> model.  I have spent a fair amount of time working through osgviewer.exe in
>>> the debuger to try to determine the what it is doing with lighting.  It
>>> seems to set up multiple lights and calls into the light::apply each frame.
>>>  Juggler sets up a sigle light and never calls into the light::apply after
>>> the initial set up.  Before I investigate this further I thought I'd asked
>>> the list since I have the suspicion that is this something simple and
>>> someone might recognive the issue my just looking at a few screen shots.  I
>>> have attached screenshots for both Juggler's OSGNav & OSGViewer and also the
>>> osg file them self.  Furthermore, I have also included a simple model of a
>>> cube that demonstrates the same effect.
>> I imagine this has something to do with how the light is being setup. I
>> would try using different settings in the:
>> http://developer.vrjuggler.org/docs/vrjuggler/2.2/programmer.reference/classv
>> rj_1_1OsgApp.html#1b1994aa3043cd522e749853595d4796
>> or setup your own light:
>> http://developer.vrjuggler.org/docs/vrjuggler/2.2/programmer.reference/classv
>> rj_1_1OsgApp.html#e0a9dc2d8da29770af997f811df10144
>> Here is what your data looks like in my VR Juggler / OSG app.
>> Doug
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> 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