primitive
Creates an implicit primitive and converts it to a given
geometry type. Contrary to implicit primitives, converted
primitives have explicit geometry elements that can be manipulated,
ex.: control points, edges, polygons...
Note: The implicit primitives must be compatible with the geometry
types. For more information, see the $cdname
X3DObject.AddGeometry@cdname method.
oReturn = CreatePrim( PresetObj, GeometryType, [Name], [Parent] ); |
Returns the primitive object (usually an X3DObject object).
Parameter | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
PresetObj | String or a preset object (see SIGetPreset) | Geometry Primitives | ||||||||||
GeometryType | String | Geometry type
|
||||||||||
Name | String | Name of the new object. | ||||||||||
Parent | String | Name of an existing object to use as the parent of the new primitive. |
'This example creates a new primitive newscene dim nurbssphere, meshsphere 'Create a nurbs sphere and name it aSphere. Assign to variable nurbssphere set nurbssphere = CreatePrim( "Sphere", "NurbsSurface", "aSphere" ) 'Create a mesh sphere and name it bSphere. Assign to variable meshsphere. 'Make bSphere child of aSphere set meshsphere = CreatePrim( "Sphere", "MeshSurface", "bSphere", "aSphere" ) 'Logged information: 'INFO : "Sphere information: X3DObject polymsh" logmessage "Sphere information: " & typename( meshsphere) & " " & meshsphere.type |