Home Pictures of 3D objects
clone

clone

You can clone objects:

b = box(pos=vec(1,1,0), axis=vec(1,1,0),
             color=color.red)
bcopy = b.clone(pos=vec(1,-1,0))

This will give you two copies of a box, differing only in their positions. After making the clone, changes to the clone do not affect the original box.

If you simply say b.clone(), all of the properties of the new object are exactly the same as those of the original object.

Current restrictions

Currently you cannot clone triangles/quads, because it is the underlying vertex objects that control their appearance. You can clone compound objects.

Currently there is no way to clone an object from one canvas to another.

JavaScript

See the cylinder documentation for how to create an object in JavaScript.

Top of page