On 4/26/07, Paul Speed <[EMAIL PROTECTED]> wrote:
So what is the effect that you are trying to achieve exactly?  It seems
to me that if you are only using the HEAD_LIGHT and all of the normals
are facing the camera then this is the same as just turning lighting off
and presetting the colors of the points.  You probably don't even need
to reset them since the desired value never changes.

No, this is an interactive viewer. As the object is rotated, then the
shading changes. Also, I compute the normals by fitting a plane to the
neighboring points. The problem is that this leaves an ambiguity in
which way the normal points. I want to assume each point is facing the
closer direction of the camera.

I am using HEAD_LIGHT, and therefore as the camera rotates through the
viewer, the relative object-light positions change.

Sandy


I'm probably missing something obvious, though.
-Paul

Sandy Patterson wrote:
> I'm trying to push the limits for throughput of points. I would
> imagine that changing the color of the points every rendering pass
> would slow things down a lot. That's why I've tried to keep everything
> hardware accelerated. That said, I havn't done any testing to see if
> it really slows things down or not.
>
> Thanks for both of your answers. Big help!
>
> Sandy
>
>
> On 4/26/07, Dorosky, Christopher G <[EMAIL PROTECTED]> wrote:
>> Why not just turn lighting off in the stateset?
>> If you need the effect, you can adjust the color of your points
>> dynamically based off the dot product of the point vector and the light
>> source vector. This is manual lighting.
>>
>>
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of Robert
>> Osfield
>> Sent: Thursday, April 26, 2007 3:38 AM
>> To: osg users
>> Subject: Re: [osg-users] backface culling using normals
>>
>> Hi Sandy,
>>
>> Back face culling is done one faces, rather than normals so it won't
>> help you.
>>
>> Using two opposing cameras might work at illuminating the back facing
>> normals, but it'll also over illuminate the scene.  To add the lights
>> use two osg::LightSource, see the osglight example.  If you want the
>> lights to move with the viewer then set ReferenceFrame on the
>> LightSource nodes to ABSOLTE_RF.
>>
>> Robert.
>>
>> On 4/26/07, Sandy Patterson <[EMAIL PROTECTED]> wrote:
>> > Hi all,
>> >
>> > I'm trying to view point data, and my problem is this:
>> >
>> > Each point in the set has color, normal, and position fields.
>> > However, the normal field is a little wonky (some are backwards) What
>> > I'd like to do is pretend that the normal is facing towards the camera
>>
>> > (flip it if it's facing away from the camera).
>> > I see two possible solutions, and i'm not sure how to do either, any
>> > help would be greatly appreciated.
>> >
>> > sol 1) use backface culling by comparing the normal to the points
>> > location relative to the camera. I'm not sure if this is possible. Can
>>
>> > we only do backface culling using windings? If this works, I can
>> > duplicate every point so i render both the normal and the -normal.
>> >
>> > sol 2) duplicate the light source so it's lit from in front and
>> > behind. Is there a way to add another light source into an
>> > osgProducer::Viewer instance with the opposite direction as
>> > osgProducer::Viewer::HEAD_LIGHT_SOURCE
>> >
>> > sol2 is probably superior in terms of performance because there is no
>> > point dupliaction.
>> >
>> > Thanks a lot for your help,
>> > Sandy Patterson
>> > _______________________________________________
>> > osg-users mailing list
>> > [email protected]
>> > http://openscenegraph.net/mailman/listinfo/osg-users
>> > http://www.openscenegraph.org/
>> >
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://openscenegraph.net/mailman/listinfo/osg-users
>> http://www.openscenegraph.org/
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://openscenegraph.net/mailman/listinfo/osg-users
>> http://www.openscenegraph.org/
>>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to