' This examples shows how to create an implicit primitive
' and convert it to a NURBS surface.
newscene
dim MyGrid, MyCamera
'Create implicit primitive. It will be named and nested under the scene root.
'We consult the returned list instead of the output parameters because
'it is better supported by other scripting languages.
set MyGrid = SIGetPrim( "Grid", "aGrid", , True)
'Logged information:
'INFO : "ISIVTCollection contains 2 elements."
'INFO : "First object is: Primitive"
'INFO : "Second object is: X3DObject"
logmessage typename(MyGrid) & " contains " & MyGrid.count & " elements."
logmessage "First object is: " & typename( MyGrid(0) )
logmessage "Second object is: " & typename( MyGrid(1) )
' It is possible to convert the implicit to a Nurbs Surface
SIConvert "NurbsSurface", MyGrid(1)
'Create a camera without an interest. It uses default values.
set MyCamera = SIGetPrim( "Camera" )
'Logged information:
'INFO : "ISIVTCollection contains 2 elements."
'INFO : "First object is: Primitive"
'INFO : "Second object is: Camera"
logmessage typename(MyCamera) & " contains " & MyCamera.count & " elements."
logmessage "First object is: " & typename( MyCamera(0) )
logmessage "Second object is: " & typename( MyCamera(1) ) |