Open topic with navigation
<viz>.startLayer
Begin the creation of a primitive within an On-The-Fly object
<viz>.startLayer( |
|
type |
name = '' |
) |
|
type
The type of primitive to draw. Can be one of the following:
viz.POINTS
viz.LINES
viz.LINE_LOOP
viz.LINE_STRIP
viz.POLYGON
viz.QUADS
viz.QUAD_STRIP
viz.TRIANGLES
viz.TRIANGLE_STRIP
viz.TRIANGLE_FAN
name = ''
The name of the layer which can be used as the node argument when changing material settings (color, texture, etc...).
Remarks
This command initiates the building of a simple or complicated geometry object that can then be easily manipulated in your script. You can have multiple geometric shapes within one On-The-Fly Object.
For more information about each primitive type, see the OpenGL documentation for
glBegin.
Note: <viz>.endLayer is only called once per object, do not call <viz>.endLayer after every startLayer.
Return Value
None
Example
viz.startLayer(viz.POINTS)
viz.vertex(0,1,0)
viz.startLayer(viz.LINES)
viz.vertex(-1,0,0)
viz.vertex(1,0,0)
object = viz.endLayer() # Object will contain both points and lines
See also