Hilfe

VertexNormal

B3D

Aufruf

VertexNormal surface%, vertex%, x#, y#, z#

Parameter

surface% Identität einer Gitteroberfläche (surface)
vertex% Indexnummer eines Vertexpunktes
x# Normal-Koordinate X
y# Normal-Koordinate Y
z# Normal-Koordinate Z


Rückgabewert

-


Beschreibung

Die Anweisung VertexNormal ändert Normal-Koordinaten eines Vertexpunktes.

Die Funktionen VertexNX, VertexNY und VertexNZ funktionieren umgekehrt - sie liefern die Normal-Koordinaten zurück.

Normals werden hauptsächlich für Lichtschattierungen benötigt.


Beispiel

Dieses Beispiel verdeutlicht den Umgang mit den Normalenbefehlen eines Vertex

Graphics3D 800, 600, 16, 2

camera = CreateCamera()
MoveEntity camera, 0, 0, - 2

light = CreateLight(1)
TurnEntity light, 45, 45, 45

sphere = CreateSphere(20)
EntityFX sphere, 4
surface = GetSurface(sphere, 1)

While Not KeyHit(1)
   TurnEntity sphere, 0, 0.1, 0
   If KeyHit(57)
      For i = 0 To CountVertices(surface) - 1
         nx# = - VertexNX(surface, i)
         ny# = - VertexNY(surface, i)
         nz# = - VertexNZ(surface, i)
         VertexNormal surface, i, nx, ny, nz
      Next
   EndIf
   RenderWorld
   Flip
Wend
End


Siehe auch

VertexCoords, VertexNX, VertexNY, VertexNZ

Übersicht 3D Grafik Surface