robertosfield wrote:
> Hi Ron, 
> OpenGL fixed function pipeline doesn't support using clip planes and lighting 
> in the way you want. This means you will need use either multiples or 
> projective texturing to achieve the result you want. 
> Robert On May 30, 2012 4:29 PM, "Ron Mayer" < ()> wrote:
> >  Hi,
> > 
> > I would like to have a colored light applied to my scene, restricted by 
> > some clipping planes.
> > For example, I would like to shed a green light on anything that is only to 
> > the right of the half plane x = 5, to the left of the half plane x = -5, 
> > above the half-plane y = 10, and under the half plane y = -10.
> > 
> > I saw there is a class osg::ClipNode related to LightSource but I am not 
> > sure how to use it. I also tried looking at the osg examples, and searched 
> > the forums but did not find anything.
> > 
> > Thank you!
> > Ron
> > 
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=47945#47945 
> > (http://forum.openscenegraph.org/viewtopic.php?p=47945#47945)
> > 
> > 
> 
> 
> 
> 
> _______________________________________________
> osg-users mailing list
>  ()
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> 


I tried implementing the texture projection today but had some difficulties 
getting it to work.
In our setup we already have one image projection setup for displaying video at 
(let's say) the z=0 plane at location (0, 0).
For this we have a scene looking like this:

[Image: http://img135.imageshack.us/img135/8341/scenej.jpg ] 
(http://imageshack.us/photo/my-images/135/scenej.jpg/)


It works nicely.
Now, I would like to define a prism around x, y = (0, 0) (on the z=0 plane) 
such that anything outside of that prism will be projected onto with a green 
color. For example, if I have a cube that is half inside and half outside the 
prism, the outside part will have the projection.

Here is what I tried:
I created an additional texture (in geode on the right side of the diagram)  
setting alpha = 0, so it will be transparent, then I called setBorderColor with 
green, and gave it a small alpha to make it transparent. I was hoping this 
would make the inside of the prism transparent and outsde green.
I then went and added a new transform and texgen under the root. I set the 
texgen to have the planes be at where I want the walls of the prism to be (I am 
using ortho projection here).

The result:
The entire world is projected with green ...

I am not sure if I should continue with this direction. One thing I thought of 
doing is creating 4 textures and having 4 texgens for each texture and 
projecting on the 4 regions around the "sterile square" I have. Top view of my 
world (looking from above the z=0 plane):

[Image: http://img198.imageshack.us/img198/3776/regionsa.jpg ] 
(http://imageshack.us/photo/my-images/198/regionsa.jpg/)


S - the sterile region (which already has texture projection at its center for 
video)
R1, R2, R3, R3 - regions where any object inside it gets projected with a red 
color, each region will have its own texture projection 

Thanks again
Ronny



 ------------------
Post generated by Mail2Forum[/quote]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47986#47986





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

Reply via email to