Jump to content


Stupid Question


7 replies to this topic

#1 mysticman

    Member

  • Members
  • PipPip
  • 95 posts

Posted 24 June 2005 - 08:21 AM

Performing the rendering of a model, where the list passed to opengl contains
over that the vertexes, texcoords, the normals, tangents and binormals.
When I rotate and / or translate the model through matrix or with the classical glRotatef...
does the process of transformation also interest the normals, tangents and binormals?

I remember you that I use the functions
qglDrawRangeElementsEXT () and qglDrawElements ()

Thanks! You excuse the stupid question :happy:

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 24 June 2005 - 08:26 AM

sure it does
If Prolog is the answer, what is the question ?

#3 mysticman

    Member

  • Members
  • PipPip
  • 95 posts

Posted 24 June 2005 - 08:44 AM

be strange, however!
I work with the shaders (arb-assembly), when I draw a wall in bump-specular, the position of the camera and the light works, while when with a model (md3) no.
That is, if the light goes to illuminate to the left the head of the model, these when it move or it rotates, the light stays to the left always. Yet I adjourn the normals, tangents and the binormals in real time.

There is something that escapes me, but I don't understand what..... :sad:

#4 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 24 June 2005 - 09:21 AM

if you are using vertex shaders the transformation doesn't happen by itself... maybe that's the problem ?
If Prolog is the answer, what is the question ?

#5 mysticman

    Member

  • Members
  • PipPip
  • 95 posts

Posted 24 June 2005 - 09:59 AM

As I have said, the transformations are calculated in a matrix. while the calculation of the T&B&Ns they are done in base to the list of animate polygons, but not with rotations and physical translations.
Is there a way of performing rotation and translation of a polygon in base to the actual state of the matrix?
Forgive me, but in algebra and mathematics I am enough dull.... :blush:

#6 mysticman

    Member

  • Members
  • PipPip
  • 95 posts

Posted 25 June 2005 - 12:04 PM

I have resolved, thanks however :wink:

#7 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 25 June 2005 - 12:27 PM

how ?
If Prolog is the answer, what is the question ?

#8 mysticman

    Member

  • Members
  • PipPip
  • 95 posts

Posted 25 June 2005 - 03:22 PM

I don't know if this way were that correct (I hope in some best help)
But the thing now seems to work

common code:

ATTRIB attr_Tangent = vertex.attrib[6];
ATTRIB attr_Binormal = vertex.attrib[7];
ATTRIB attr_Normal = vertex.normal;
...
...


Before I used these functions :

DP3 var_lightVec.x, attr_Tangent, lightVec;
DP3 var_lightVec.y, attr_Binormal, lightVec;
DP3 var_lightVec.z, attr_Normal, lightVec;

DP3 var_viewVec.x, attr_Tangent, viewVec;
DP3 var_viewVec.y, attr_Binormal, viewVec;
DP3 var_viewVec.z, attr_Normal, viewVec;


now these:


PARAM mviMatrix[4]={state.matrix.modelview.invtrans};


TEMP tangent, binormal, normal;

DP4 tangent.x, mviMatrix[0], attr_Tangent;
DP4 tangent.y, mviMatrix[1], attr_Tangent;
DP4 tangent.z, mviMatrix[2], attr_Tangent;
MOV tangent.w, 1.0;
DP4 binormal.x, mviMatrix[0], attr_Binormal;
DP4 binormal.y, mviMatrix[1], attr_Binormal;
DP4 binormal.z, mviMatrix[2], attr_Binormal;
MOV binormal.w, 1.0;
DP4 normal.x, mviMatrix[0], attr_Normal;
DP4 normal.y, mviMatrix[1], attr_Normal;
DP4 normal.z, mviMatrix[2], attr_Normal;
MOV normal.w, 1.0;

DP3 var_lightVec.x, tangent, lightVec;
DP3 var_lightVec.y, binormal, lightVec;
DP3 var_lightVec.z, normal, lightVec;

DP3 var_viewVec.x, tangent, viewVec;
DP3 var_viewVec.y, binormal, viewVec;
DP3 var_viewVec.z, normal, viewVec;
...
...


I hope that this code, Reedbeta also sees it, which thank still for the help given me.
:lol:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users