# Java 3D game: 3d space, camera positioning

• 01-04-2014, 06:12 PM
vastrolorde
Java 3D game: 3d space, camera positioning
I dont have any code to show, because im still trying to figure out how to do it.

1: 3D space. How do i define the space where i will make my world? Is there a certain point that i will define as 0,0,0 or is there some other way.

2: Camera positioning. When i have the 3D space, how to i make it so that the camera will show that what i want it to show. Lets say il define its lokatios 30,50,100 and direction is NW, then how to i make it so that is see the SW direction from the point 30,50,100?
• 01-05-2014, 03:40 AM
zFollette
Re: Java 3D game: 3d space, camera positioning
Quote:

Originally Posted by vastrolorde
I dont have any code to show, because im still trying to figure out how to do it.

1: 3D space. How do i define the space where i will make my world? Is there a certain point that i will define as 0,0,0 or is there some other way.

2: Camera positioning. When i have the 3D space, how to i make it so that the camera will show that what i want it to show. Lets say il define its lokatios 30,50,100 and direction is NW, then how to i make it so that is see the SW direction from the point 30,50,100?

Do you need to do this with java libraries? If not, use a different library, I just started to learn some LWJGL 3D programming.
• 01-05-2014, 10:01 AM
vastrolorde
Re: Java 3D game: 3d space, camera positioning
Well id prefer to do this with java libaries, just for learning. To get a better understanding of how this works. I have the calculation to create 3D projection(only one variable needm ore research) and i have the calculation for camera rotation. Just need to know how to create the space and how to position camera so that it will show what i want i to show.
• 01-05-2014, 12:47 PM
zFollette
Re: Java 3D game: 3d space, camera positioning
Quote:

Originally Posted by vastrolorde
Well id prefer to do this with java libaries, just for learning. To get a better understanding of how this works. I have the calculation to create 3D projection(only one variable needm ore research) and i have the calculation for camera rotation. Just need to know how to create the space and how to position camera so that it will show what i want i to show.

• 01-06-2014, 05:55 PM
vastrolorde
Re: Java 3D game: 3d space, camera positioning
Anyone else? I would like to try and use quaternical formula and 3D projection formula... but i dont know how do i but the X Y Z coordinates in. Where to i get the space coordinates.
• 01-09-2014, 01:54 AM
Daryn
Re: Java 3D game: 3d space, camera positioning
I am sorry to say that I dont believe java works in 3 dimensions althought if you watch this 3D Programming With Java Tutorial 3 - 2D Square to 3D Cube - YouTube it may help. I HAVE NOT WATCHED THIS VIDEO. Now althought I do not no any direct way to make 3d games, this is programming if you have the right know how anything is possible. Also you might want to try a game making software. I started on Unity that has extactly what you are asking for except you can only program in JavaScript,C#, and Python
• 01-09-2014, 04:09 AM
pj6444
Re: Java 3D game: 3d space, camera positioning
Java does work in 3 dimensions. If you think about it, it's all about the perspective that you make. A cube is just six rectangular faces drawn at different perspectives. It is complex but 3d can be done with any language that has graphics.
• 01-09-2014, 10:39 AM
JosAH
Re: Java 3D game: 3d space, camera positioning
Quote:

Originally Posted by vastrolorde
I dont have any code to show, because im still trying to figure out how to do it.

1: 3D space. How do i define the space where i will make my world? Is there a certain point that i will define as 0,0,0 or is there some other way.

2: Camera positioning. When i have the 3D space, how to i make it so that the camera will show that what i want it to show. Lets say il define its lokatios 30,50,100 and direction is NW, then how to i make it so that is see the SW direction from the point 30,50,100?

There are several possibilities: e.g. let your 3D model be somewhere near (0,0,0) and give your camera a location not at (0,0,0) 'aiming' towards (0,0,0); it doesn't matter where (0,0,0) is, it's an infinite 3D space and you define it anywhere you want it to be. An alternative is to position the camera at location (0,0,0) and the subject somewhere else, but I prefer the first alternative.

kind regards,

Jos
• 01-09-2014, 10:47 AM
gimbal2
Re: Java 3D game: 3d space, camera positioning
Quote:

Originally Posted by Daryn
I am sorry to say that I dont believe java works in 3 dimensions

Of course not, neither does your computer so why would any programming platform? This is about 3D projection, which is on a 2D surface in the form of your flat computer screen (or multiple 2D surfaces). And that's all math, it is not bound to any tool, OS, computer or programming platform - math is a universal language and tool. You could do it on your calculator if it is advanced enough to rasterize graphics. They did it on 8 mhz Amiga computers in the early 90's.