solaris-js
Version:
A reusable component for interactive visualization of the Solar System
24 lines (16 loc) • 663 B
text/coffeescript
import publicize from './helpers/publicizer'
import {Geometry, LineBasicMaterial, Line, Vector3} from 'three'
class $Orbit
constructor: (vertices, color, ) ->
geometry = new Geometry
geometry.vertices =
material = new LineBasicMaterial {color}
= new Line(geometry, material)
convertVertices: (vertices) ->
(new Vector3().fromArray(.convert(v)) for v in vertices)
update: (vertices) ->
.geometry.vertices =
.geometry.verticesNeedUpdate = true
export default class Orbit extends publicize $Orbit,
properties: ['line']
methods: ['update']