We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
OpenGL API Specifications
Documents and Learning ResourcesSupport Libraries and FrameworksFunction Libraries and GeneratorsThis list contains some basic resources for getting started with, and developing for, OpenGL 3.0 and onwards. Contact your forum moderator if you want to contribute to the list or have any comments.Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 15 April 2011 - 10:09 AM
Posted 15 April 2011 - 12:08 PM
Posted 15 April 2011 - 12:26 PM
Posted 16 April 2011 - 01:28 AM
I want learn how to handle your own matrices ???, how does modeview matrix actually work. How to render and move things in 3D. I do not think I completely understand it TBH.
Posted 18 April 2011 - 06:43 AM
I want learn how to handle your own matrices ???, how does modeview matrix actually work. How to render and move things in 3D. I do not think I completely understand it TBH.
Two simplifications:
A matrix describes a coordinate system, the columns are x,y,z and origin. That's all there is to it (unless you add scaling or shearing). Don't worry about mathematical details of what happens when you multiply, just think "M = A*B" means "apply transformations in A after applying transformations in B". The result can still be directly read as coordinate system.
The mysterious w-coordinate on vectors can be thought of like this: w = 0 -> direction vector, w = 1 -> position vector (yes, it applies to matrices, the axes have w=0, the position/translation has w=1). If you do the math yourself you will see how it removes the translation part when multiplying with a matrix and when you look at GLs lighting model you will see how it makes the difference between a point light and a directional light.
More bla:
OpenGL is actually hiding stuff in a way that is both convenient and confusing. glRotate isn't magic, it just creates a rotationMatrix and does modelview = rotation * modelview. Same with glTranslate. D3D forces you to do it yourself, so you can't ignore what really happens. Seems more tedious, but ignorance isn't always bliss (look at the kind of questions arising from trying to achieve everything with these to glCursed functions). You want to forget about them if you handle your matrices yourself. If you don't move the point of view (or "camera", though technically such a thing doesn't exist) you can just directly glLoadMatrix your objects matrix and render it. Else you first need to apply the inverse of your "imaginary" camera's matrix (and yes, it simply transforms everything rendered afterwards -aka "the world"- in the opposite way).
"How to render and move things" suggests a wrong order. You can't move stuff after rendering it (it's just a bunch of pixels in the frame buffer now). First you setup your matrix to have it drawn in the right place, then you render. If you move it, you use a different matrix when drawing the next frame.
Posted 18 April 2011 - 07:40 AM
Thanks, I was looking at some matrixes and it is definetly confusing. OpenGL handles so I guess we do not have to worry about it. I like your example M= A*B and how OpenGL handle matrix in reverse order. I am not sure about the model and view matrix. Model handle from objecr space to world space and view from world spcae to eye space. It is confusing
Posted 24 April 2011 - 01:31 AM
Nehe tutorial ? or what resources on internet I should follow. I have ordered OpenGL superbible 5th edition from amazon so it should be in my hands in 4 days but I would like to know how you guys learned OpenGL programming ?
Posted 24 April 2011 - 01:50 AM
OpenGL doesn't handle matrices in reverse order. (If you're referring to the transforms being applied in the order B->A rather than A->B, this is simply a consequence of the fact that most OpenGL references use column-vector notation. But, it's not 'reversed' with respect to anything in particular.)I like your example M= A*B and how OpenGL handle matrix in reverse order.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.