Sign in to follow this  
JDUK

Are there any (simple) tutorials on 3D movemet/matrices?

Recommended Posts

JDUK    100
I'm currently following tutorials (video, web, code comments) and learning DirectX for use with 3D and also looking at some engines (Ogre, TV3D). But unfortunately most tutorials start like this: "Due to the fact we dont have a gazillion pages for this tutorial we have already implemented, DX initialization, mesh, animation and texture loading and camera movement in a partial project which you can download in the accompanying .zip ... and we have left out programmable pipelines and shaders".... Which REALLY sucks because aside from the initialization and non animated mesh loading... that's just about everything I need to learn [depressed] Code comments around things like camera movement are along these lines: //Some maths gumph that moves things! Which is also far from helpfull. So I'm in need of a walk through of the maths on how to move and rotate objects in 3D games. This brings up another problem.... My maths ability is about the equivalent of a 14 year old kid (I'm 12 years its senior [depressed] ) I know enough to code win apps, count my pocket change, work out the area of triangles and circles, etc.... So I also need something that speaks to me on my level. An example of an example over my head is: Form 3D Games book I took out at the library.
|x1|  |1 0 0 0 -Tx| |x|
|y1|  |0 1 0 0 -Ty| |y|
|z1|  |0 0 1 0 -Tz| |z|
| 1|  |0 0 0 1   1| |1|

= T12 = (T21)-1

...Which is the transformation that translates the origin of system 1 to that of system 2....
Whaaa? that is totally beyond me and then some... So far in my 3D app i have a mesh that is the floor and I want the right and left arrows to move the camera in a circular motion, while it remains fixed looking at the centre of that floor surface.... that's the kinda tutorial im after but one that explains exactly what all this x = t*Sin(B)*Sin(a) breaks down into so i dont end up coding-by-numbers but actualy understand and can adapt what im learning. I know thats a bit of a tall order, but if any ones come across one of those tutorials in thier travels please pass me a link. Thanks. [Edited by - JDUK on April 28, 2006 7:36:03 AM]

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
Original post by JDUK
I'm currently following tutorials (video, web, code comments) and learning DirectX for use with 3D and also looking at some engines (Ogre, TV3D).

But unfortunately most tutorials start like this:
"Due to the fact we dont have a gazillion pages for this tutorial we have already implemented, DX initialization, mesh, animation and texture loading and camera movement in a partial project which you can download in the accompanying .zip ... and we have left out programmable pipelines and shaders"....

Which REALLY sucks because aside from the initialization and non animated mesh loading... that's just about everything I need to learn [depressed]

Code comments around things like camera movement are along these lines:
//Some maths gumph that moves things!

Which is also far from helpfull.

So I'm in need of a walk through of the maths on how to move and rotate objects in 3D games.
There are some nice articles here on gdnet; as for books, this is my favorite introductory reference on game math.
Quote:
This brings up another problem.... My maths ability is about the equivalent of a 14 year old kid (I'm 12 years its senior [depressed] ) I know enough to code win apps, count my pocket change, work out the area of triangles and circles, etc.... So I also need something that speaks to me on my level.
Don't be discouraged - if the subject interests you, stick with it. I also started out with practically zero math knowledge, but in a few years was able to get somewhat up to speed. You do have to have some patience, as it can take a while, but if you have a lot of time to devote to it you could likely learn the basics in a few months.
Quote:
An example of an example over my head is:
Form 3D Games book I took out at the library.

|x1| |1 0 0 0 -Tx| |x|
|y1| |0 1 0 0 -Ty| |x|
|z1| |0 0 1 0 -Tz| |x|
| 1| |0 0 0 1 1| |x|

= T12 = (T21)-1

...Which is the transformation that translates the origin of system 1 to that of system 2....


Whaaa? that is totally beyond me and then some...
You shouldn't expect that sort of thing to make sense until you've learned at least the basics of matrix and vector algebra. A book like the one I mentioned earlier will help with that. (Also, that particular example is a bit puzzling - perhaps you copied it to the post wrong?)
Quote:
So far in my 3D app i have a mesh that is the floor and I want the right and left arrows to move the camera in a circular motion, while it remains fixed looking at the centre of that floor surface.... that's the kinda tutorial im after but one that explains exactly what all this x = t*Sin(B)*Sin(a) breaks down into so i dont end up coding-by-numbers but actualy understand and can adapt what im learning.
This particular example sounds like an 'orbital' camera that rotates about a fixed target. For a quick and dirty solution, you can use the 'look at' function of your chosen API to handle setting up the camera matrix for you. The only thing left is calculating the position using spherical coordinates, which is what it looks like your example is doing. Googling 'spherical cartesian coordinate conversion' may help somewhat with that, but if you get stuck you can always start a new thread here on the subject.

Good luck.

Share this post


Link to post
Share on other sites
JDUK    100
Thanks for a great reply!
Like an idiot I missed the FAQ (I assumed one would be sticky at the top of the thread list, as opposed to next to the thread link on the main forum page)... Though now i've been reading the lecture slides (type thing) linked to in the FAQ about Vectors and Matricies...

And its suprisingly intresting! (much more than GCSE maths seemed when i was a kid)... I'm very supprised the majority of 3D games tutorials dont start off with "You need to know this stuff first!!!" then link to books and pages about this kind of thing...
It's all "Here is how to get Tiny/Sarge running on the spot, etc".. a lot of 'running before you can walk' has been going on in almost all tutorials on 3D games I've been reading... Glad I'm on the right track now.

I'll definatley check out that book, thanks again.

Share this post


Link to post
Share on other sites
Math seems to get a lot easier when you're into programming. I used to get in the 70s-80s in any math class, after I started C++ a couple years ago I've been getting 100s on everything.

I think it's because they're both just logic.

Share this post


Link to post
Share on other sites
Programmer16    2321
I've read several books on 3D math and 3D engines. The 3 that I like best are "Introduction to Game Programming With DirectX 9.0", "3D Primer for Graphics and Game Development", and "Tricks of the 3D Game Programming Gurus: Advanced 3D graphics and rasterization" (the last one is very tough to read because of its complexity, but once you start to understand things it gets a lot easier.)

Quote:
Original post by JDUK
Thanks for a great reply!
(I assumed one would be sticky at the top of the thread list, as opposed to next to the thread link on the main forum page).


There is a link to the Forum FAQ at the top of almost every page in the forums (right above the title, 3 links over).

Share this post


Link to post
Share on other sites
JDUK    100
Thanks for all the info on books guys... one thing thats important to me in a book of this type is constantly showing the practicle appliction in games and graphics.
Prahaps through a "Write a program to solve this problem" type assignment at the end of chapters.

Im currently 14 chapters through the Vector Math for 3D Computer Graphics tutorial, linked to in the FAQ... But the parallels between what I am learning and how they apply to computer graphics is scant... Which isn't a bad thing, in this case, as I needed a fly-by-the-seat-of-my-pants maths power-cram... But when i buy a book I will be looking for a more "Here's how to apply it in real world programs" type aproach

Whats the best book out of those mentioned for this kind of aproach?

Thank you all again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this