| | |
maths for 3d?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Posts: n/a
Solved Threads: n/a
I'm trying to program a spinning cube using basic draw commands (eg 10 draw 320,200 to 340,200 etc Not openGL). I know it sounds a bit basic but I'm interested in the maths of it. Does anyone know how to project an object in perspective and rotate it? I've read books on matrices but I'm none the wiser. Peace and love, Crazy Ben.
•
•
Join Date: Aug 2002
Posts: 71
Reputation:
Solved Threads: 3
This tutorial relates to Macromedia Flash but it's the same exact concept. It's actually not that hard...hope it helps.
http://www.flashkit.com/tutorials/3D...-189/index.php
http://www.flashkit.com/tutorials/3D...-189/index.php
•
•
Posts: n/a
Solved Threads: n/a
To Evilmonkey29
Thanks - I've been to the site and I've learnt a few things, but I'm still a bit stuck. One of the tutorials said that in order to get a 3d object onto a 2d screen you need to divide by z so that the coordinates become x/z and y/z. Now I can sort of understand that as things go further into the distance then z will increase, and if you make the centre of the screen the vanishing point(0,0) then as z increases the objects get smaller and smaller until they vanish at the centre. The problem is, how do I rotate something with x/z and y/z. The closest equation I can get is:
draw 0,0 to x/(cos*angle*hypoteneuse),(sin*angle*hypoteneuse)/(cos*angle*hypoteneuse)
but it doesn't look right.
Any ideas? Ben
Thanks - I've been to the site and I've learnt a few things, but I'm still a bit stuck. One of the tutorials said that in order to get a 3d object onto a 2d screen you need to divide by z so that the coordinates become x/z and y/z. Now I can sort of understand that as things go further into the distance then z will increase, and if you make the centre of the screen the vanishing point(0,0) then as z increases the objects get smaller and smaller until they vanish at the centre. The problem is, how do I rotate something with x/z and y/z. The closest equation I can get is:
draw 0,0 to x/(cos*angle*hypoteneuse),(sin*angle*hypoteneuse)/(cos*angle*hypoteneuse)
but it doesn't look right.
Any ideas? Ben
![]() | Mark as Unsolved |
Similar Threads
Other Threads in the HTML and CSS Forum
- Previous Thread: Tab control on hidden input fields
- Next Thread: Cookies makers?
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7





