three.rb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/demo/app/main.rb +15 -16
- data/lib/opal/three/core/box_geometry.rb +13 -0
- data/lib/opal/three/core/mesh.rb +11 -0
- data/lib/opal/three/core/mesh_basic_material.rb +11 -0
- data/lib/opal/three/core/perspective_camera.rb +3 -1
- data/lib/opal/three/core/scene.rb +2 -0
- data/lib/opal/three/core/webgl_renderer.rb +1 -0
- data/lib/opal/three/core.rb +4 -1
- data/lib/opal/three/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f917c4db993b8513e69a161c747c808029e23489
|
4
|
+
data.tar.gz: baf5c59271aa63eeae46b5c451e8838381982d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53c4151905dbf5e79ba358410368365a75f804c965366715d1d28da726d3ae39d1b96e99860029697003584baa101faa989927415f4d4a65bfceb62f481aa6b9
|
7
|
+
data.tar.gz: b91526299ee59a8f9b85e5274de782901fd135b98f789a3cbf76f3dba6cfc87d3151169fbb78c3e5d754e66b054ae23d9684ffae22e8591c3b42323a1fd716ca
|
data/demo/app/main.rb
CHANGED
@@ -10,20 +10,19 @@ camera = THREE::PerspectiveCamera.new(field_of_view: 75, aspect_ratio: aspect_ra
|
|
10
10
|
|
11
11
|
renderer = THREE::WebGLRenderer.new
|
12
12
|
renderer.set_size($$.innerWidth, $$.innerHeight)
|
13
|
-
renderer.dom_element.
|
13
|
+
$document.body << renderer.dom_element.to_n
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
#end
|
15
|
+
geometry = THREE::BoxGeometry.new(width: 1, height: 1, depth: 1)
|
16
|
+
material = THREE::MeshBasicMaterial.new( color: 0x00ff00 )
|
17
|
+
cube = THREE::Mesh.new(geometry, material)
|
18
|
+
scene.add(cube)
|
19
|
+
|
20
|
+
camera.position.z = 5
|
21
|
+
|
22
|
+
render = proc do
|
23
|
+
$$.requestAnimationFrame(render)
|
24
|
+
cube.rotation.x += 0.1
|
25
|
+
cube.rotation.y += 0.1
|
26
|
+
renderer.render(scene, camera)
|
27
|
+
end
|
28
|
+
render.call
|
@@ -8,7 +8,9 @@ module THREE
|
|
8
8
|
near = arg_hash[:near]
|
9
9
|
far = arg_hash[:far]
|
10
10
|
|
11
|
-
@native = `new THREE.
|
11
|
+
@native = `new THREE.PerspectiveCamera(field_of_view, aspect_ratio, near, far)`
|
12
12
|
end
|
13
|
+
|
14
|
+
alias_native :position
|
13
15
|
end
|
14
16
|
end
|
data/lib/opal/three/core.rb
CHANGED
@@ -2,4 +2,7 @@ require 'native'
|
|
2
2
|
|
3
3
|
require 'opal/three/core/scene'
|
4
4
|
require 'opal/three/core/perspective_camera'
|
5
|
-
require 'opal/three/core/webgl_renderer'
|
5
|
+
require 'opal/three/core/webgl_renderer'
|
6
|
+
require 'opal/three/core/box_geometry'
|
7
|
+
require 'opal/three/core/mesh_basic_material'
|
8
|
+
require 'opal/three/core/mesh'
|
data/lib/opal/three/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: three.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Plymale
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-03-
|
13
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: opal
|
@@ -74,6 +74,9 @@ files:
|
|
74
74
|
- demo/index.html
|
75
75
|
- lib/opal/require_core.rb
|
76
76
|
- lib/opal/three/core.rb
|
77
|
+
- lib/opal/three/core/box_geometry.rb
|
78
|
+
- lib/opal/three/core/mesh.rb
|
79
|
+
- lib/opal/three/core/mesh_basic_material.rb
|
77
80
|
- lib/opal/three/core/perspective_camera.rb
|
78
81
|
- lib/opal/three/core/scene.rb
|
79
82
|
- lib/opal/three/core/webgl_renderer.rb
|