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
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
...@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
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
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#
5 matches
Mail list logo