JuanCarlosAragon / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

Inconsistencies between meshes classes #357

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In my project I am using primarily Box and Cylinder meshes. So I noticed some 
inconsistencies between the two classes (there could be more with other meshes 
as well):

1. Size: The dimensions of the box are half of what is created. The dimensions 
of the cylinder are not. For instance, the specified height of a cylinder is 
the height of the rendered geometry. Specifying some dimensions of a box 
renders a geometry that has twice the size.

2. Constructor signature: the box allows to specify the center of the mesh, the 
cylinder does not.

Original issue reported on code.google.com by bizio...@gmail.com on 7 Jun 2011 at 2:37

GoogleCodeExporter commented 8 years ago
Thats why the one parameter is called halfExtents and the other height.

Original comment by normen667 on 7 Jun 2011 at 6:55

GoogleCodeExporter commented 8 years ago
That is actually the inconsistency I am talking about. Why some meshes are 
defined with half-height parameters, while others are defines as full height? 
Should all the meshes be defined according to standard measurements like width, 
radius, height, lenght, etc?

Also, I don't see any "halfExtents" parameters in the Box mesh (one could also 
notice other inconsistencies in the JavaDoc like the lack of the parameter 
"name"). I am probably missing something, however, in the nightly building I 
have, a Box is defined as:

    /**
     * Creates a new box.
     * <p>
     * The box has a center of 0,0,0 and extends in the out from the center by
     * the given amount in <em>each</em> direction. So, for example, a box
     * with extent of 0.5 would be the unit cube.
     *
     * @param name the name of the box.
     * @param x the size of the box along the x axis, in both directions.
     * @param y the size of the box along the y axis, in both directions.
     * @param z the size of the box along the z axis, in both directions.
     */
    public Box(float x, float y, float z)...

Original comment by bizio...@gmail.com on 7 Jun 2011 at 8:19

GoogleCodeExporter commented 8 years ago
These patterns for creating 3d primitive shapes are quite consistent among 3d 
systems, for further discussion of the topic I invite you to go to the 
jmonkeyengine.org forum. To reiterate the issues frontpage, this issue system 
is reserved for defined bugs with hints at solutions and no user support page.

Original comment by normen667 on 7 Jun 2011 at 11:35

GoogleCodeExporter commented 8 years ago
Thank you! I'll do that.

Original comment by bizio...@gmail.com on 8 Jun 2011 at 2:17