-
Notifications
You must be signed in to change notification settings - Fork 36
Python_CreateGeometricObjects
Daniel Stoeckel edited this page Feb 20, 2015
·
2 revisions
The following example creates a simple box with given color:
{{{ #!python
size = 3 v1 = Vector3(0.) v2 = Vector3(size, 0, 0) v3 = Vector3(0, size, 0) v4 = Vector3(0, 0, size)
colored_box = Box(v1, v2, v3, v4) colored_box.setColor(ColorRGBA(1, 0, 0, 0.8))
r = Representation() r.insert(colored_box)
getMainControl().insert(r)
getMainControl().update(r) }}}
Here a sphere is created:
{{{ #!python
r = 4 pos = Vector3(0.)
s = Sphere() s.setRadius(r) s.setPosition(pos)
color = ColorRGBA(1, 0, 0, 0.8) s.setColor(color)
r = Representation() r.insert(s) getMainControl().insert(r) getMainControl().update(r) }}}
The examples are intended for usage within BALLView.