FacetCollection.NormalArray operator

説明

法線を x,y,z 値の 2D Arrayとして戻します。

C#構文

// get accessor

Object rtn = FacetCollection.NormalArray;

1. VBScript の例

set oRoot = Application.ActiveProject.ActiveScene.Root

set oCube = oRoot.AddGeometry( "Cube", "MeshSurface" )

set oGeometry = oCube.ActivePrimitive.Geometry

aNormals = oGeometry.Facets.NormalArray

for i = LBound(aNormals, 2) to UBound(aNormals, 2)

	Application.LogMessage "normal[" & i & "] =" & aNormals(0,i) & "," & aNormals(1,i) & "," & aNormals(2,i)

next

' Expected result:

'INFO : normal[0] =0,0,-1

'INFO : normal[1] =0,-1,0

'INFO : normal[2] =-1,0,0

'INFO : normal[3] =1,0,0

'INFO : normal[4] =0,1,0

'INFO : normal[5] =0,0,1

2. JScript の例

var oCube = Application.ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" ) ;

var oGeometry = oCube.ActivePrimitive.Geometry ;

aNormals = new VBArray( oGeometry.Facets.NormalArray ) ;

for ( i = aNormals.lbound(2) ; i <= aNormals.ubound(2) ; i++ )

{

	Application.LogMessage( "normal[" + i + "] =" + aNormals.getItem(0,i) + "," +

				aNormals.getItem(1,i) + "," + aNormals.getItem(2,i) ) ;

}

// Expected result:

//INFO : normal[0] =0,0,-1

//INFO : normal[1] =0,-1,0

//INFO : normal[2] =-1,0,0

//INFO : normal[3] =1,0,0

//INFO : normal[4] =0,1,0

//INFO : normal[5] =0,0,1