umituzun84 wrote:
> Hi Paul;
>
> Watch the video. It can tell you much of dot and cross product :)
>
> http://video.google.com/videosearch?q=cross+product&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&um=1&ie=UTF-8&ei=LE4dSreZCpLt_AbS4OGxDQ&sa=X&oi=video_result_group&resnum=4&ct=title
Hi Paul;
Watch the video. It can tell you much of dot and cross product :)
http://video.google.com/videosearch?q=cross+product&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&um=1&ie=UTF-8&ei=LE4dSreZCpLt_AbS4OGxDQ&sa=X&oi=video_result_group&resnum=4&ct=title#
Regards.
2009/5/27 Paul G
Kim C Bale wrote:
> I presume this line:
>
> n = (pos1 -pos0) ^ (pos2 - pos1);
>
> is a cross product of two vectors. i.e. the normal, also known as the
> vector perpendicular to the two vectors that define the plane.
>
> In which case you would want to use the glsl function cross(vec3,vec3)
>
...@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
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 b
al Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul
Griffiths
Sent: 27 May 2009 12:02
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] vertex shader help: compare position against
plane
I know the code:
vec
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
7 matches
Mail list logo