Class: Mittsu::IcosahedronGeometry
- Inherits:
-
PolyhedronGeometry
- Object
- Geometry
- PolyhedronGeometry
- Mittsu::IcosahedronGeometry
- Defined in:
- lib/mittsu/extras/geometries/icosahedron_geometry.rb
Instance Attribute Summary
Attributes inherited from Geometry
#bounding_box, #bounding_sphere, #colors, #dynamic, #face_vertex_uvs, #faces, #has_tangents, #id, #line_distances, #morph_colors, #morph_normals, #morph_targets, #name, #skin_indices, #skin_weights, #type, #uuid, #vertices
Instance Method Summary collapse
-
#initialize(radius = 1.0, detail = 0) ⇒ IcosahedronGeometry
constructor
A new instance of IcosahedronGeometry.
Methods inherited from Geometry
#apply_matrix, #center, #clone, #compute_bounding_box, #compute_bounding_sphere, #compute_face_normals, #compute_line_distances, #compute_morph_normals, #compute_tangents, #compute_vertex_normals, #dispose, #from_buffer_geometry, #merge, #merge_mesh, #merge_vertices, #to_json
Methods included from EventDispatcher
#add_event_listener, #dispatch_event, #has_event_listener, #remove_event_listener
Constructor Details
#initialize(radius = 1.0, detail = 0) ⇒ IcosahedronGeometry
Returns a new instance of IcosahedronGeometry.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mittsu/extras/geometries/icosahedron_geometry.rb', line 7 def initialize(radius = 1.0, detail = 0) t = (1.0 + ::Math.sqrt(5)) / 2.0 vertices = [ - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 ] indices = [ 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 ] super(vertices, indices, radius, detail) @type = 'IcosahedronGeometry' @parameters = { radius: radius, detail: detail } end |