Point, line, and Surface Generation (1) -- Introduction to Geometry

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.