Re: [osg-users] vertex shader help: compare position against plane

2009-05-27 Thread Paul Griffiths
I know the code: vec3 worldPos = gl_ModelViewMatrix * gl_Vertex; is worng, if i rotate the view so does this position. i need the world position and not the modelview position. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13023#13023

Re: [osg-users] vertex shader help: compare position against plane

2009-05-27 Thread Paul Griffiths
ok, i got the world position with: Code: mat4 ToWorldMatrix= osg_ViewMatrixInverse* gl_ModelViewMatrix; vec3 worldPos = ToWorldMatrix * gl_Vertex; now i need to check which side of the plane the worldPos is. I googled and found some code for this but its not for glsl, ive came up with this

Re: [osg-users] vertex shader help: compare position against plane

2009-05-27 Thread Kim C Bale
...@lists.openscenegraph.org] On Behalf Of Paul Griffiths Sent: 27 May 2009 13:40 To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] vertex shader help: compare position against plane ok, i got the world position with: Code: mat4 ToWorldMatrix= osg_ViewMatrixInverse* gl_ModelViewMatrix; vec3 worldPos

Re: [osg-users] vertex shader help: compare position against plane

2009-05-27 Thread Ümit Uzun
Hi Paul; Watch the video. It can tell you much of dot and cross product :) http://video.google.com/videosearch?q=cross+productoe=utf-8rls=org.mozilla:en-US:officialclient=firefox-aum=1ie=UTF-8ei=LE4dSreZCpLt_AbS4OGxDQsa=Xoi=video_result_groupresnum=4ct=title# Regards. 2009/5/27 Paul Griffiths

Re: [osg-users] vertex shader help: compare position against plane

2009-05-27 Thread Paul Griffiths
umituzun84 wrote: Hi Paul; Watch the video. It can tell you much of dot and cross product :) http://video.google.com/videosearch?q=cross+productoe=utf-8rls=org.mozilla:en-US:officialclient=firefox-aum=1ie=UTF-8ei=LE4dSreZCpLt_AbS4OGxDQsa=Xoi=video_result_groupresnum=4ct=title#