Class: Disp3D::NodeSphere
- Defined in:
- lib/node/node_sphere.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #box ⇒ Object
-
#initialize(geom = nil, name = nil) ⇒ NodeSphere
constructor
A new instance of NodeSphere.
Methods inherited from NodeLeaf
Methods inherited from Node
#ancestors, #post_draw, #pre_draw
Constructor Details
#initialize(geom = nil, name = nil) ⇒ NodeSphere
Returns a new instance of NodeSphere.
8 9 10 11 12 13 14 |
# File 'lib/node/node_sphere.rb', line 8 def initialize(geom=nil, name=nil) super @radius = 1.0 @center = Vector3.new() @slices = 10 @stacks = 10 end |
Instance Method Details
#box ⇒ Object
16 17 18 19 |
# File 'lib/node/node_sphere.rb', line 16 def box rtn_box = Box.new(Vector3.new(-@radius,-@radius,-@radius)+@center, Vector3.new(@radius,@radius,@radius)+@center) return box_transform(rtn_box) end |