Results 1 to 4 of 4

Thread: How to manipulate Matrixs in GL3?

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    4

    How to manipulate Matrixs in GL3?

    Hi,
    I'm trying to port one of my previous work to GL3, and I notice that nearly a whole section of "Coordinate Transformations" has been removed in GL3's specification, including all of matrix operations. It is seems that all ModelView and Perspective transformation works have to be done by vertex shaders. However, my previous work use a lot of GL's matrix operations to implement rotate and projection.

    I've searched in Google, and find that if I want to save my code structure I have to do the matrix operations myself, or at least use something like OpenGL Mathematics (http://glm.g-truc.net/) to simulate the old GL to do the mathematics works. Now I'm writing an SSE matrix library, however I still believe that to use CPU to do the computation will hurt the performance.

    If I stick on hardware computation, I have to rewrite most of my code, do the transformation in shaders. In my old code, the position of an object is computed by a sequence of rotate--transfer--rotate--transfer...---scale, different objects use different sequences. In old GL, push/pop matrix can help me, what about GL3? Do I need to write specific shaders for different objects?

    Can anyone tell me why the community deprecated such operations, and what replacement they prefer?

    Thank you!

  2. #2
    Senior Member Frequent Contributor scratt's Avatar
    Join Date
    May 2008
    Location
    Thailand
    Posts
    555

    Re: How to manipulate Matrixs in GL3?

    Well, if you want those features you could try enabling a context with support for the Deprecation model.

    Other than that there are a few Open Source solutions out there to provide maths libraries.

    You could also write them yourself.

    Here's quite an interesting thread where most of what you ask is discussed:
    http://www.gamedev.net/community/for...opic_id=509060

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2009
    Posts
    4

    Re: How to manipulate Matrixs in GL3?

    Thanks for your answer. Now I know the matrix operations are done by software and they are slow.

  4. #4
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: How to manipulate Matrixs in GL3?

    "and they are slow"

    they don't need to be slow. compiler optimizations and memory alignment can put those classes into SSE. same as a driver would do before sending them to further processing.

Similar Threads

  1. Replies: 1
    Last Post: 07-12-2013, 03:41 PM
  2. Best way to manipulate textures
    By force in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 09-21-2010, 05:38 AM
  3. directional matrixs values
    By zed in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 05-16-2006, 12:53 AM
  4. Manipulate Pixels
    By guest in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-18-2003, 03:09 PM
  5. does openg multiply not necessary matrixs?
    By eigenafx in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-31-2001, 04:37 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