The condition"
1. The color array corresponding to the vertex coordinate array and the vertex coordinate must be given.
2. The point, line, and plane are subclasses or grandchildren of geometryarray, so they inherit all its methods.
3. because geometry objects are all geometric objects, they cannot be placed in a 3D scene map separately, because only three-dimensional shapes can display three-dimensional effects, including vertices and lines, the above objects cannot see 3d effects. Point, line, surface, and other geometric objects must be assigned to shape3d (leaf subclass) ry to be displayed in 3D scenarios. Objects such as cone. Box, cylinder, and sphere already belong to the shape, so they can be directly used in 3D scenarios.
The following describes the relationship between geometry, its parent class, and its subclass.
Geometryarray constructor:
Geometryarray (INT vertexcount, int vertexformat );
Vertexcount: Number of vertex Arrays
Vertexformat can be:
Coordinates vertex coordinate array color_3 color array without Alpha value // these two are frequently used
Color_4 color array with Alpha value normals vertex Normal Array
Texture_coordinate_2 2D texture coordinate array texture_coordinate_3 3D texture coordinate Array
When using this, you must add the specific class name and "."
Common geometry methods include:
Setcoordinate (INT index, float coordinate []); setcolor (INT index, float color []) // index indicates the index start subscript, generally 0
Settexturecoordinate (INT index, point2f textcoord) // This method is rarely used
The above three methods have corresponding get methods. The parameters are the same, so we will not write them out one by one here.
In addition,AfterProgramBounds to be used in a brief introduction:
In the Java3D program, you often need to set some lighting, sound, behavior and other objects. These objects must provide their scope of action for normal display.