intrinsic-152 Set3DRenderMode

Top  Previous  Next

152: Set3DRenderMode(Handle, Item, Mode);

 

This intrinsic controls the way 3D objects are displayed.

 

Arguments:

 

Handle. This is an integer value that must contain a valid handle. The handle must be for a 3D object like a Mesh, Lines or Strings. It cannot be a Frame.

 

Item. This is an integer value that specifies the item that will be set by the Mode argument. There are two items:

 

0 - Render Item. If this option is selected, the Mode value controls the way meshes are rendered. Here is a description of each mode value:

 

0 = Wire Frame. In this mode, each triangle in a Mesh is displayed as a series of three lines, depicting the edges of the triangle.

 

1 = Flat Faces. In this mode, each triangle is depicted as a flat face, with smoothing between triangles.

 

2 = Smoothed Faces. In this mode, the program uses Gouraud shading to smooth the transition between triangle faces. In order for this mode to work, you must set the normals for the mesh using the Set3DNormals intrinsic.

 

1 - Lighting Item. If this item is selected, the Mode value is an integer Boolean that controls the way 3D objects are lit. Here is a description of each mode value:

 

false = Lighting is only applied to parts of meshes that are facing the front of the screen. The front and back side of a mesh are determined by the order of the vertices in each triangle. If the vertices are in counter-clockwise order, then the triangle is facing front. This works best where you have a closed object, (such as a sphere or a cube) and you never view the interior. It is also faster.

 

true = In this mode, both sides of a mesh are lighted. This is useful if you are going to be viewing both sides of a mesh or you want to view the interior of closed objects. To light the back side of triangles, the Normals for each triangle are reversed.