Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / [Tutorial] Guide to 3D Math

Author
Message
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 12th Jan 2011 16:00 Edited at: 1st Feb 2011 17:43
Hello everyone,

As I have just completed the first part of a series of tutorials I'm planning to do, I would like to see if I can have some input about whether or not it's understandable or not.
English is not my mother language, so I would like (if possible) for someone to proof-read this.

The tutorials will cover pretty much every basic thing you can do with 3D math. For now, I started with vectors (I wanted to start with something less hard). I already have prototype tutorials for matrices, square matrices and I was planning to start on a prototype for transformations of vectors and homogeneous coordinates, followed by a description of the rendering transformations used by DirectX. I do not plan to go too theoretical, so that this tutorial will stay understandable to most beginners as well. The goal is to provide programmers some tools to solve problems that might not be possible without vectors.

Vectors in DBP

Requirements:
- Basic knowledge about trigonometry.
- A left or a right hand.
- Some basic mathematical background (*, -, +, /, using symbols, ...).
Index


Download

[edit] It seems that all images were horribly distorted when converting to PDF format. I will try to fix this.
[edit] Fixed.
[edit] Sorry, I noticed a few errors...
[edit] 13/01/2011 Update
[edit] 16/01/2011 Update
[edit] 1/02/2011 Smaller PDF file

Easy Transformations in DBP


Requirements:
- A basic understanding of vectors

This tutorial covers the basics of what you need to know to work with transformations. No real math knowledge is needed for this one.

Index:


Download

Matrices and Transformations in DBP


Requirements:
- Preferably good understanding of the concepts in the tutorial "Vectors in DBP".
- Basic trigonometry
- Mental preparation
- Some time

This tutorial contains everything that I think you should know about matrices and transformations to fully understand it. This means that it contains much more than the basic idea of transformations.

Index


Download

Any input is appreciated.

Cheers!
Sven B

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th Jan 2011 17:26 Edited at: 12th Jan 2011 17:32
Nice work Sven B.

I'll take a good look at this

EDIT: One thing that I do see immediately is that there isn't much (if any) example DBP code to show how the maths might be used. That would be really helpful to those who don't understand how to put formulas like the Dot Product into practice...

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 12th Jan 2011 18:22
Thanks Baxslash,

I think you're right. It'd be better if I included some examples on how to apply the 3D math commands in DarkBasic Pro. I'll try to think of some examples.

Cheers!
Sven B

Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 13th Jan 2011 01:25
Actually there's already a tutorial on vectors.
http://www.neurofuzzydev.com/V/D/index.htm


Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Jan 2011 08:15 Edited at: 13th Jan 2011 08:17
Hi Eminent,

I am aware of that. The reason I created another tutorial was because I couldn't find any tutorials about vectors that were sufficient for understanding transformations, which will be discussed later. Especially homogeneous coordinates which are used intensively in 3D math transformations and in DirectX as well.

Cheers!
Sven B

GreenDixy
16
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 13th Jan 2011 12:21
Thank you very much great work on the tut!

======================================

GreenDixy Productions http://GreenDixy.Com
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Jan 2011 14:12
Thanks!

I have taken Baxslash's comment to heart and I've added more information about the DarkBasic Pro commands. I've also included two simple DBP samples.

I'll be starting on matrices and transformations in the near future.

Cheers!
Sven B

Dances With Robots
13
Years of Service
User Offline
Joined: 13th Jan 2011
Location:
Posted: 13th Jan 2011 21:01
Umm. . .Wow. You rock.

*Off to Khan Academy to brush up on trig*
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Jan 2011 01:29 Edited at: 14th Jan 2011 01:29
awesomesauce!

You might still want to have a section of derivations/proofs for people interested in the why of it all. I find that whenever I break something it's usually because i'm not sure why whatever it is I want to be doing works in the first place. (Like if someone tried to try to take the acos of the dot product between a normalized vector <x,y>, and <1,0>, and didn't know why it wasn't returning the angle of <x,y> )

Also, there's still a lot of great material in that "Vectors Don't Bite" tutorial. No problem in ripping/compiling a bunch of the information in there!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 14th Jan 2011 08:28
Thanks a lot guys!

I started on the tutorial about "Matrices and Transformations in DBP" yesterday. I'm doing my best not to get theoretical again.

Quote: "You might still want to have a section of derivations/proofs for people interested in the why of it all."


You're right. Maybe I could do a tutorial for the more advanced users around here. But I first wanted to have a few tutorials that both beginners and semi-advanced programmers could understand so they have something to start with.
Besides, I need to think a little more on what and how I will implement in the 'advanced' tutorial. I don't think anyone's interested in a 400 pages counting book on Linear Algebra.

I will check out your tutorial again. I roughly checked it out (clicking on a few chapters) in general but I didn't really read through it. Maybe I'll take you up on the offer.

Cheers!
Sven B

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jan 2011 13:27
I know what a vector is, but I don't think your tutorial really explained what it is in section 2.

In the vector addition and subtraction, I might be wrong here but I don't think the example drawing is correct. To properly get the green vector(a+b) as a result of vectors A(red) and B(blue), shouldn't the B vector's origin be the same as A's? The illustration kind of indicates that the addition of A and B results in the new vector ending up in the same position as B. Am I making sense?

I can follow the tutorial because I'm already familiar with the material. I know you know how to use vectors, but I'm trying to look at this as someone with 0 knowledge.

If I wanna get nit-picky, then your dot product section kinda trails off very early and starts talking about vector lengths and normalizing. Maybe split that up as a subsection?

When you're talking about the 'W' component in the Homogeneous Coordinates section, I think you might want to include a practical example to show when and how someone would use this.

Overall, its fairly well written and I like how its laid out and easy to read.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 14th Jan 2011 14:15 Edited at: 14th Jan 2011 14:17
Thanks for your input.

Quote: "I know what a vector is, but I don't think your tutorial really explained what it is in section 2."


It's very hard to explain a vector because it's actually a very abstract notion. This is why I immediately went for the visualization of a vector, so we at least have something to work with.
Well, maybe I could elaborate a little more on it though. Throw in some examples, etc.

Quote: "In the vector addition and subtraction, I might be wrong here but I don't think the example drawing is correct."


You're right. I stated that a vector starts in the origin, but this is is not what's displayed on the drawing. I'll redraw it.

Quote: "If I wanna get nit-picky, then your dot product section kinda trails off very early and starts talking about vector lengths and normalizing. Maybe split that up as a subsection?"


Might be a good point. My intention was to show that a vector length and normalizing followed straight out of a dot product (which is usually also the case in linear algebra).

Quote: "but I'm trying to look at this as someone with 0 knowledge."


That's exactly what I was aiming for by posting it here

Quote: "When you're talking about the 'W' component in the Homogeneous Coordinates section, I think you might want to include a practical example to show when and how someone would use this."


I will think of some examples and maybe create some drawing along with it. It's a relatively unknown concept to most when compared to vectors.

Well, back to work

Cheers!
Sven B

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Jan 2011 23:03
Quote: "I will check out your tutorial again. I roughly checked it out (clicking on a few chapters) in general but I didn't really read through it. Maybe I'll take you up on the offer."

o, roite, I didn't write the tutorial, but I'm hosting it because its been hard for me to find in the past. It was just the tutorial that I learned tons of vector math from xD

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Jan 2011 13:45
Hi guys, I updated the tutorial in the first post. I have pretty much changed everything mentioned by Phaelax.

I think I can continue on the tutorial about matrices.

Quote: "o, roite, I didn't write the tutorial, but I'm hosting it because its been hard for me to find in the past. It was just the tutorial that I learned tons of vector math from xD"


Oh... lol.
Well I didn't really take anything from it. I realized that the tutorial was pretty much finished and I couldn't find anything I would add.

Cheers!
Sven B

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Feb 2011 12:08 Edited at: 1st Feb 2011 12:14
Matrices and Transformations in DBP


Requirements:
- Preferably good understanding of the concepts in the tutorial "Vectors in DBP".
- Basic trigonometry
- Mental preparation
- Some time

This tutorial contains everything that I think you should know about matrices and transformations to fully understand it. This means that it contains much more than the basic idea of transformations.



Download

I noticed that for novices, it isn't necessary to fully understand the mechanics behind a transformation, so I will write a small, light-weight tutorial leaving all that out.

[edit] I will probably change this tutorial a few times. There are still some parts I'm not quite happy with.

Cheers!
Sven B

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Feb 2011 17:42 Edited at: 1st Feb 2011 17:42
Easy Transformations in DBP


Requirements:
- A basic understanding of vectors

This tutorial covers the basics of what you need to know to work with transformations.

Index:


Download

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 03:55:34
Your offset time is: 2024-11-23 03:55:34