|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.j3d.utils.geometry.NormalGenerator
The NormalGenerator utility will calculate and fill in the normals of a GeometryInfo object. The calculated normals are estimated based on an analysis of the indexed coordinate information. If your data isn't indexed, index lists will be created.
If two (or more) triangles in the model share the same coordinate index then the normal generator will attempt to generate one normal for the vertex, resulting in a "smooth" looking surface. If two coordinates don't have the same index then they will have two separate normals, even if they have the same position. This will result in a "crease" in your object. If you suspect that your data isn't properly indexed, call GeometryInfo.recomputeIndexes().
Of course, sometimes your model *has* a crease in it. That's what creaseAngle is. If two triangles' normals differ by more than creaseAngle, then the vertex will get two separate normals, creating a discontinuous crease in the model. This is perfect for the edge of a table or the corner of a cube, for instance.
Constructor Summary | |
NormalGenerator()
Constructor. |
|
NormalGenerator(double radians)
Constructor. |
Method Summary | |
void |
generateNormals(GeometryInfo geom)
Generate normals for the GeometryInfo object. |
double |
getCreaseAngle()
Returns the current value of the crease angle, in radians. |
void |
setCreaseAngle(double radians)
Set the crease angle. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public NormalGenerator(double radians)
public NormalGenerator()
Method Detail |
public void generateNormals(GeometryInfo geom)
public void setCreaseAngle(double radians)
public double getCreaseAngle()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |