createIndexedFaceSet

Syntax

createIndexedFaceSet(Nodes:length[3,*], Faces:length[][][, Colors:integer[]]) → any

The method createIndexedFaceSet creates an indexed face set in the scene window.

Parameters

  • The parameter Nodes is a two-dimensional array of data type length which sets the positions of the nodes, which follow, in space.

  • The parameter Faces is an array of arrays of data type length which sets the number of faces which follow. Each inner array contains a sequence of node indexes which set the contour of the respective face.

    Note:

    The function only works correctly, when you define convex faces.

  • The optional parameter Colors of data type integer sets the color. When you pass a single color, this color is used for the entire graphic. When you pass an array of colors, each color applies to one of the faces.

Return Value

The return value has the data type any and specifies the created graphic, compare the method _3D.getGraphic.

Example

var Nodes: real[3, 8]
var Faces: any[6]
var LineSequences: any[6]
var Colors: integer[6]
var Color: integer
var tmpArray: integer[4]
var GraphicGroup := .Modelle.Modell._3D.holeGrafik("deco")

Nodes[1, 1] := 1;   Nodes[2, 1] := 1;   Nodes[3, 1] := 1
Nodes[1, 2] := 1;   Nodes[2, 2] := 1;   Nodes[3, 2] := -1
Nodes[1, 3] := 1;   Nodes[2, 3] := -1;  Nodes[3, 3] := 1
Nodes[1, 4] := 1;   Nodes[2, 4] := -1;  Nodes[3, 4] := -1
Nodes[1, 5] := -1;  knoten[2, 5] := 1;   Nodes[3, 5] := 1
Nodes[1, 6] := -1;  Nodes[2, 6] := 1;   Nodes[3, 6] := -1
Nodes[1, 7] := -1;  Nodes[2, 7] := -1;  Nodes[3, 7] := 1
Nodes[1, 8] := -1;  Nodes[2, 8] := -1;  Nodes[3, 8] := -1

tmpArray[1] := 1
tmpArray[2] := 2
tmpArray[3] := 4
tmpArray[4] := 3
Faces[1]  := tmpArray
print tmpArray -- ^[1, 2, 4, 3]

tmpArray[1] := 5
tmpArray[2] := 6
tmpArray[3] := 8
tmpArray[4] := 7
Faces[2]  := tmpArray

tmpArray[1] := 1
tmpArray[2] := 3
tmpArray[3] := 7
tmpArray[4] := 5
Faces[3]  := tmpArray

tmpArray[1] := 2
tmpArray[2] := 4
tmpArray[3] := 8
tmpArray[4] := 6
Faces[4]  := tmpArray

tmpArray[1] := 1
tmpArray[2] := 5
tmpArray[3] := 6
tmpArray[4] := 2
Faces[5]  := tmpArray

tmpArray[1] := 3
tmpArray[2] := 7
tmpArray[3] := 8
tmpArray[4] := 4
Faces[6]  := tmpArray

Colors[1] := makeRGBValue(255,255,0)
Colors[2] := makeRGBValue(255,0,255)
Colors[3] := makeRGBValue(0,0,255)
Colors[4] := makeRGBValue(0,255,0)
Colors[5] := makeRGBValue(255,0,0)
Colors[6] := makeRGBValue(0,0,0)

Color       := makeRGBValue(255,255,255)

LineSequences := Faces

GraphicGroup.createIndexedFaceSet(Nodes, Faces, Colors).Position.X := -5
GraphicGroup.createIndexedFaceSet(Nodes, Faces, Color).Position.X := 0
GraphicGroup.createIndexedLineSet(Nodes, LineSequences, Color).Position.X := 5

Related Topics

Detailed Access To Graphics

_3D.getGraphic