class Disp3D::NodeSphere

Public Class Methods

new(geom=nil, name=nil) click to toggle source
Calls superclass method Disp3D::NodeLeaf::new
# 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

Public Instance Methods

box() click to toggle source
# 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

Protected Instance Methods

draw_element() click to toggle source
# File lib/node/node_sphere.rb, line 22
def draw_element
  draw_color
  GL.Translate(@center.x, @center.y, @center.z) if(@center)
  GLUT.SolidSphere(@radius, @slices, @stacks)
end