Java-Gaming.org Hi !
 Featured games (83) games approved by the League of Dukes Games in Showcase (542) Games in Android Showcase (133) games submitted by our members Games in WIP (604) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 Looking for a good book/guide to 3D  (Read 1497 times) 0 Members and 1 Guest are viewing this topic.
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 http://portfolio.eckish.net/010_3D_Conversion/load.jnlp.  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.

Thanks,

Dave
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. http://www.amazon.com/s/ref=nb_ss_gw?url=search-alias%3Daps&field-keywords=OpenGL+Programming+Guide&x=0&y=0

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
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 http://www.glprogramming.com/red/.  Unfortunately, it does not cover the math I am looking for.
Riven
« League of Dukes »

« JGO Overlord »

Medals: 849
Projects: 4
Exp: 16 years

 « 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
weston

Junior Devvie

 « 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. http://www.amazon.com/Mathematics-Programming-Computer-Graphics-Development/dp/1584502770/ref=pd_sim_b_img_3

for(int i = 1; i > 0; i++)
{
System.out.println(i+" cups of java downed");
}
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

You cannot reply to this message, because it is very, very old.

 Add your game by posting it in the WIP section, or publish it in Showcase. The first screenshot will be displayed as a thumbnail.
 Elsealabs (14 views) 2014-12-28 10:39:27 CopyableCougar4 (18 views) 2014-12-28 02:10:29 BurntPizza (21 views) 2014-12-27 22:38:51 Mr.CodeIt (14 views) 2014-12-27 04:03:04 TheDudeFromCI (19 views) 2014-12-27 02:14:49 Mr.CodeIt (26 views) 2014-12-23 03:34:11 rwatson462 (58 views) 2014-12-15 09:26:44 Mr.CodeIt (47 views) 2014-12-14 19:50:38 BurntPizza (96 views) 2014-12-09 22:41:13 BurntPizza (115 views) 2014-12-08 04:46:31
 Rayvolution 50x BurntPizza 30x basil_ 29x HeroesGraveDev 25x LiquidNitrogen 22x appel 18x kpars 18x KevinWorkman 15x Riven 15x princec 14x pitbuller 13x gouessej 13x NegativeZero 13x SHC 12x KudoDEV 12x Ecumene 11x
 How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27Resources for WIP games2014-08-01 16:20:17Resources for WIP games2014-08-01 16:19:50
 java-gaming.org 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‑gaming.org