Java-Gaming.org Hi !
 Featured games (90) games approved by the League of Dukes Games in Showcase (714) Games in Android Showcase (214) games submitted by our members Games in WIP (787) 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 2109 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

« JGO Overlord »

Medals: 1265
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 rankings!
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. 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.

 Rule (55 views) 2017-03-19 12:43:22 Rule (48 views) 2017-03-19 12:42:17 Rule (59 views) 2017-03-19 12:36:21 theagentd (63 views) 2017-03-16 05:07:07 theagentd (69 views) 2017-03-15 22:37:06 theagentd (65 views) 2017-03-15 22:32:18 theagentd (63 views) 2017-03-15 22:31:11 ral0r2 (126 views) 2017-03-03 11:52:41 ral0r2 (124 views) 2017-03-03 11:42:24 Archive (311 views) 2017-02-27 19:41:49
 basil_ 19x philfrei 13x Apo 11x dime26 10x Archive 9x FrozenShade 9x bornander 7x KaiHH 7x FabulousFellini 7x SteveSmith 7x princec 7x Riven 6x CJC 6x Spasi 6x orangepascal 5x Ecumene 5x
 List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05SF/X Librariesby SkyAphid2017-03-02 06:38:56SF/X Librariesby SkyAphid2017-03-02 06:38:32SF/X Librariesby SkyAphid2017-03-02 06:38:05SF/X Librariesby SkyAphid2017-03-02 06:37:51
 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