gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > 3D Transformation Formula

#140656 - thegamefreak0134 - Tue Sep 18, 2007 10:21 pm

This is really frustrating to me right now. I've successfully created a simple 3D engine before, but I lost it and I am trying to re-create it. I had a really good tutorial with the proper information to translate and rotate object in a 3D field before projecting them to a 2D plane, with all the information on z-sorting polygons and such, but I can't seem to find it.

If you can help me find this tutorial again, it was a guy writing a 3D engine in QBasic. Everything about it was just great, he was really easy to understand.

If you can't find that (I had no luck with a variety of search options) could someone please post here the formulas I would need to re-create my engine? (Not in matrix form, I can't work with that yet.) I just need the formulas to translate and rotate in 3D, and then the projection formula that can account for a viewport size and the formula used for calculating Z-normals. I think I can run from there with the rest, this is going to be a simple engine.

Thanks!

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#140664 - keldon - Tue Sep 18, 2007 11:04 pm

http://en.wikipedia.org/wiki/3D_projection

http://tfpsly.free.fr/Docs/TomHammersley/

http://www.siggraph.org/education/materials/HyperGraph/viewing/view3d/perspect.htm

Unfortunately they've destroyed the wikipedia article, it used to begin with the basic trigonometry approach, which makes the most sense to a beginner.

Just think, all you are really doing is that little triangle inside of a triangle formula (shown below) where there inside triangle is the 2d screen point, and the outside triangle is the 3d point.
Code:
        /
       /|
      / |
     /  |
    /|  |
   / |  |
  /  |  |
 /   |  |
/--------


p.s. it's late (in the UK) but let me know if this is of no help and I'll occasionally pop in here while I'm at work along with whoever else can contribute. Doing 3d is actually quite easy once you've got into it, but there's so many different ways to start with it.

#141918 - keldon - Mon Oct 01, 2007 5:13 pm

How are you getting on?

#142054 - thegamefreak0134 - Wed Oct 03, 2007 11:44 pm

I got it to work, finally. I found a fair few sites with the proper info, and went from there. I actually found my original site after a while, and now my engine is up and running. Thanks! Oh, and I agree about the Wiki, it was no help at all. ^_^

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#142067 - Rajveer - Thu Oct 04, 2007 1:58 am

Could you post the link to the original article? Sounds like it might be useful...

#142092 - keldon - Thu Oct 04, 2007 8:14 am

Rajveer wrote:
Could you post the link to the original article? Sounds like it might be useful...

Well wikipedia does keep archives of its pages, so here it is about 2 years ago. See the "simple version" at the bottom. They really need to fix the article, I've added to the discussion about it.