Results 1 to 4 of 4

Thread: Math-transformations question

  1. #1

    Math-transformations question

    This may be an obvious question for you but here it goes:

    Given glFrustum(-1,1,-1,1,1,10); That means that the near frustum 'poly' has coordinates (-1,1),(1,1)(1,-1) and (-1,-1). If I want to know the coords of this same polygon after moving or rotating the camera what should I do to the vertices? Should I multiply the matrix by some other matrix?

    Well, hope you can understand my question...cya!

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000

    Re: Math-transformations question

    You should multiply these four corodinates by the modelview matrix. But remember that you have to use homogenous vectors.

    The coordinates you mentioned is the following as homogenous vectors: (-1, 1, 1, 1), (1, 1, 1, 1), (1, -1, 1, 1) and (-1, -1, 1, 1). The third '1' is for the near plane, and the fourth '1' is the fourth coordinate that makes it homogenous, more commonly known as W. This is, more or less, always 1.

  3. #3

    Re: Math-transformations question

    Sure, I understand that, but if I multiply all vertices by the modelview matrix I will get the transformed vertices...What I want to do is to know the coordinates of this poly after moving the camera, so I can have the near frustum plane coordinates after doing some rotations/translations/etc. Imagine I want to draw the near plane frustum (pretty stupid, cause you will see nothing but a big screen sized quad) in front of the camera. What can you tell me?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    B.C., Canada

    Re: Math-transformations question

    Shouldn't you be doing all camera transformations using the modelview matrix anyways? In which case Bob's method works fine.


Similar Threads

  1. Replies: 6
    Last Post: 11-23-2015, 10:34 AM
  2. Math question about vectors. Please HELP
    By fandecine in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 11-30-2002, 11:51 PM
  3. Very stupid math question
    By Halcyon in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 11-30-2002, 08:42 AM
  4. transformations on images - simple question
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-17-2002, 04:46 PM
  5. Math question???
    By jpummill in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 04-10-2002, 06: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