Vizard 7 » Command Index » Vizard modules » viz » <viz>.endLayer
7.7

<viz>.endLayer

Ends the creation of an On-The-Fly object

<viz>.endLayer(  
parent = viz.WORLD  
scene = viz.MainScene  
)  
parent = viz.WORLD
viz.WORLD
viz.SCREEN
viz.ORTHO
<node3d> object
scene = viz.MainScene
If the parent is viz.WORLD or viz.SCREEN, then the argument represents the scene to add the object to.
If the parent is viz.ORTHO, then the argument represents the window to add the object to.
If the parent is a valid node3d object, then the argument is ignored.

Remarks

This is the last step in the creation of an On-The-Fly object. There must have been a call to <viz>.startLayer before this.

On-The-Fly objects have lighting disabled on them by default. You can enabling lighting by using the <node3d>.enable command. In order for lighting to work properly, you will need to specify a normal vector for each vertex using the <viz>.normal command.

Return Value

<node3d:onthefly> object

Example

viz.startLayer(viz.QUADS)
viz.vertex(-1,1,0)
viz.vertex(1,1,0)
viz.vertex(1,-1,0)
viz.vertex(-1,-1,0)
quad = viz.endLayer()
quad.setPosition([0,2,0])

See also

<viz>.startLayer
<viz>.vertex
<viz>.vertexColor
<viz>.texCoord
<viz>.normal
<viz>.lineWidth
<viz>.pointSize