Here’s 2 pictures of programs I did while running through the tutorials for good practice (no point in rushing trying to build a game without solid foundation of the basics). I was able to replicate a Windows logo in 3D space but separated each box by a good distance:
I think tried to break this down into simpler steps to understand the coordinates, and ran into trouble. The image has my questions attached:
If anyone can draw onto my picture and explain this to me, it would help a ton.
I can’t seem to figure out how length of 1, height of 1, and width of 1 = 2x2x2 box.
I also cant figure out why a 1,1,1 box with coordinates of (1, -1, 1) would intersect with a box of coordinates (0, 0, 1) unless those Vector3f(#, #, #) were center points? Are they?
Anyways, drawing on my image with vertices would help myself and others immensely. Thanks!!
The box is created with halfextents meaning the vector you supply points from he middle of the box to one corner. So a Box(new Vector3f(1,1,1)) gives you a 2x2x2 box.
So (1, 1, 1) is the center point of the box?
If the box is (1, 1, 1), 2, 1, 1 instead of (1, 1, 1), 1, 1, 1 like I had it in the code, then how big would my box be?
“So a Box(new Vector3f(1,1,1)) gives you a 2x2x2 box.”, I don’t understand why the POSITION would determine the SIZE (2X2X2) like you are saying. Shouldnt the 3 numbers AFTER the initialization of the Vector3f determine the SIZE??
Sorry, this constructor doesnt exist, I meant Box(new Vector3f(),1,1,1); or Box(1,1,1);
The vector in this constructor is the center of the box but you should not “move” the Box which is only the mesh, but move the Geometry object if you want to move around your box in a game or something.
Ok thanks normen, I think I got it, but one last confirmation from you please, if you don’t mind:
If we create a box that starts with a vector of (1, 1, 1), and you say this is the CENTER of the box, does the SIZE of the box (1, 1, 1), mean 1 going in the POSITIVE X direction from the center and 1 going in the NEGATIVE X direction? This is the only way that a box of size 2 x 2 x 2 makes sense to me (physically).
:) Correct?
shadowprotocol said:
If we create a box that starts with a vector of (1, 1, 1), and you say this is the CENTER of the box, does the SIZE of the box (1, 1, 1), mean 1 going in the POSITIVE X direction from the center and 1 going in the NEGATIVE X direction? This is the only way that a box of size 2 x 2 x 2 makes sense to me (physically).
Yes, the extension from the center in both directions, exactly as the javadoc states. Your image is correct.