Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 1429 times)
0 Members and 1 Guest are viewing this topic.
Offline Eckish

Senior Newbie





« Posted 2008-05-10 19: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
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #1 - Posted 2008-05-10 20: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
Offline Eckish

Senior Newbie





« Reply #2 - Posted 2008-05-10 21: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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Riven
« League of Dukes »

JGO Overlord


Medals: 747
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2008-05-10 23: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

Junior Member





« Reply #4 - Posted 2008-05-10 23: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");
}
Offline Eckish

Senior Newbie





« Reply #5 - Posted 2008-05-11 00: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.

CogWheelz (9 views)
2014-07-30 21:08:39

Riven (20 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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
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!