Results 1 to 2 of 2

Thread: how can i multiply a vertex coord by a matrix in a vp?

  1. #1
    Guest

    how can i multiply a vertex coord by a matrix in a vp?

    hi, i need to multiply a vertex's texture coordinates by the texture matrix in order to make projective texturing in a vertex program. The problem is that i have little knowledge about matrix math and i don't know how to do the multiplication of a vector by a matrix, can someone help me, please?

  2. #2
    Guest

    Re: how can i multiply a vertex coord by a matrix in a vp?

    hey jcabeleira, maybe something like this:

    Code :
    ...
     
    ATTRIB  tc = vertex.texcoord[?];
    TEMP    result;
    PARAM   texMat[4] = { state.matrix.texture[?] };
     
    # matrix multiply is just 4 dot products
    # tc (row) into each texture matrix column
    DP4     result.x, tc, texMat[0];
    DP4     result.y, tc, texMat[1];
    DP4     result.z, tc, texMat[2];
    DP4     result.w, tc, texMat[3];
     
    ...
    hope this helps!

Similar Threads

  1. Matrix multiply order
    By 3DPrgmer in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-01-2017, 07:07 AM
  2. Multiply current Matrix with the stacked Matrix
    By ColacX in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-22-2009, 02:07 PM
  3. modelview/projection matrix multiply order
    By mjs1 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-20-2004, 04:17 PM
  4. Multiply Vecor by Matrix??!
    By TheBlob in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-16-2002, 01:09 PM
  5. How to multiply point by Current Matrix?
    By GameMaker in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-24-2001, 03:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean