Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Looking for a good book/guide to 3D  (Read 2539 times)
0 Members and 1 Guest are viewing this topic.
Offline Eckish

Senior Newbie

« Posted 2008-05-10 17:49:11 »

I am trying to make the transition from 2D to 3D and I am having some issues with figuring certain things out.  I have read through almost all of the programming guide on the OpenGL homepage.  I am able to draw in 3D, but I can't interact with 3D. 

You can see what I mean at  I basically took my 2D game map and rotated it around to something similar to isometric.  Everything interacts with each other correctly, because nothing has changed as far as game mechanics go.  The world has no real height and is still 2D in that sense.  If you try clicking to move around, you will see my first obstacle.  I need to translate the x and y I get from a mouse click to an x and y that corresponds to my 2D map that is flipped around. 

My first thought is to approximate the line that would be generated if I shot a beam straight out from where my mouse cursor is.  And then calculate where this beam intersects with the plane that rests along the x and y axis.   Since I have no height, the z point of intersection would be 0, so I think it should be fairly easy to calculate.  However, I can't seem to figure out how to calculate that interesection.  I googled line and plane intersection calculations and came up with a few pages that describe the process.  However, they use equations for 3D lines and planes that use variables I don't recognize.  And to make it worse, they don't explain the variables. 

I am pretty strong in math.  I got A's in both Calc 1 and Calc 2.  However, almost everything we did in those classes used 2 variables.  What I am looking for is a book/guide that will assume I'm a 3D newb (because I am) and teach me 3D geometry.  If anyone knows of a guide that describes the solution to my particular problem in detail, that would be helpful too.  However, I think the former would better for me in the long run.


Offline Eli Delventhal

JGO Kernel

Medals: 42
Projects: 11
Exp: 10 years

Game Engineer

« Reply #1 - Posted 2008-05-10 18:49:13 »

I would check the the red OpenGL Programming Guide.

It's a great introduction to 3D concepts as well as OpenGL, and if you get an old edition you can buy it for something like $2.00.

See my work:
OTC Software
Offline Eckish

Senior Newbie

« Reply #2 - Posted 2008-05-10 19:59:38 »

Thanks, but that is the book I am already reading.  It is available for free at  Unfortunately, it does not cover the math I am looking for.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven

« JGO Overlord »

Medals: 1340
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #3 - Posted 2008-05-10 21:02:04 »

The 'magic' plane variables (nx, ny, nz, d) are derived from a point in space and a normal.

When you ignore the point and normal, and only view the resuling plane 'as is', you'll see that only the normal (nx, ny, nz) is relevant, and when you'd go to (the one) perpendicular (to the origin) point on the plane, you can then calculate the distance between those 2 points, which is named 'd'.

So 'd' in  (nx,ny,nz,d) means that the point on the plane is: nx*d,ny*d,nz*d, with the normal: nx,ny,nz.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline weston
« Reply #4 - Posted 2008-05-10 21:04:42 »

Check out the table of contents on this one, if you are looking to learn the stuff rather than to just find a solution to that particular problem.

for(int i = 1; i > 0; i++)
     System.out.println(i+" cups of java downed");
Offline Eckish

Senior Newbie

« Reply #5 - Posted 2008-05-10 22:11:29 »

Thanks, Weston.  That book looks promising.  And yeah, I'm more interested in learning the concepts for the long haul. 
Pages: [1]
  ignore  |  Print  

EgonOlsen (74 views)
2018-06-10 19:43:48

EgonOlsen (55 views)
2018-06-10 19:43:44

EgonOlsen (74 views)
2018-06-10 19:43:20

DesertCoockie (254 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (154 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (808 views)
2018-03-24 14:43:53

Solater (172 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!