Sha256: 1009d54082093987cbb30b588514defad8d5874327c6bb026f46e8a1a05143dd
Contents?: true
Size: 878 Bytes
Versions: 14
Compression:
Stored size: 878 Bytes
Contents
#= require "./dom-helpers" {div, link} = Suite setup_preview = -> Jax.Controller.create "jax_suite", index: -> @object = new Jax.Model mesh: new Jax.Mesh.Sphere, position: [0,0,-3] @world.addObject @object mouse_dragged: (m) -> @object.camera.pitch m.diffy * -0.01 @object.camera.yaw m.diffx * 0.01 update: -> @object.mesh.material = @material canvas = $("#preview")[0] canvas.context = new Jax.Context canvas, root:"jax_suite" controller = -> $("#preview")[0].context.current_controller material = (name) -> div link(name, -> controller().material = name false ) $(document).ready -> for material_name in Jax.Material.all() $("#material-list").append material(material_name) setup_preview() $("#mesh").change -> controller().object.mesh = eval("new #{@options[@selectedIndex].value}()");
Version data entries
14 entries across 14 versions & 1 rubygems