Sorry I am new to jMonkey… I wonder, why the constructors of Box and Sphere are so different?
I can create Box having center and dimensions: http://hub.jmonkeyengine.org/javadoc/com/jme3/scene/shape/Box.html#Box(com.jme3.math.Vector3f, float, float, float)
But I can’t create Sphere with center and radius. Why???
You have to define how many polygons are in a sphere. In a perfect sphere you would have infinite polygons; well that just wouldn’t work on a computer. It needs to know how detailed you want it to be, hence the parameters.
So you have to define how many radial divides, and how many slices there are. Think longitude and latitude lines defining the polygons.
Agree, but why there is no constructor with center coordinates for Sphere while it is one for Box?
You position the sphere using the Geometry’s local translation.
geom.setLocalTranslation(x,y,z);
Please read https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies
Yes, I understand how to position the Sphere. My question is what are the reasons for such a design?
@dims said:
Yes, I understand how to position the Sphere. My question is what are the reasons for such a design?
These are very basic shapes. 99 times of 100, a user will be creating their own meshes or loading a model. These objects are the bare minimum and so some niceties will have been left out.
I've often thought we should remove the center argument from Box because it just confuses people... but it's really too late to be removing things now.
Thanks, I was thinking so but was also thinking that was misunderstanding some concept…