geo3d 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geo3d.rb +6 -5
- data/lib/{matrix.rb → geo3d/matrix.rb} +0 -2
- data/lib/{plane.rb → geo3d/plane.rb} +0 -0
- data/lib/{quaternion.rb → geo3d/quaternion.rb} +0 -0
- data/lib/{triangle.rb → geo3d/triangle.rb} +31 -0
- data/lib/{utils.rb → geo3d/utils.rb} +0 -0
- data/lib/{vector.rb → geo3d/vector.rb} +0 -0
- data/lib/geo3d/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28094cb127ac5c0a2c4a01b210ad4d265205d109
|
4
|
+
data.tar.gz: 5f787ed19f07201aed9d4dda6a1d4d4ac4918086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12af94d86202307720d2461f0d6ac5ada0185247f66149707595354b47d9618fc57144b831fe0af3b97dc190b5c0cca8cd1a16ad3c529d62f12526ec66f8d8e3
|
7
|
+
data.tar.gz: 2dd6dc08fa562f43478f091e9cd0ff8774abd2a074120cc2b621a9df411e7c392e9a0bc52bc9f0096b3fd83beee7a059ced354d2c339be086fe96264d537dfc2
|
data/lib/geo3d.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'geo3d/version'
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require '
|
2
|
+
require 'geo3d/utils'
|
3
|
+
require 'geo3d/vector'
|
4
|
+
require 'geo3d/matrix'
|
5
|
+
require 'geo3d/quaternion'
|
6
|
+
require 'geo3d/plane'
|
7
|
+
require 'geo3d/triangle'
|
7
8
|
|
8
9
|
|
File without changes
|
File without changes
|
@@ -26,6 +26,37 @@ module Geo3d
|
|
26
26
|
(b - a).cross(c - a).normalize
|
27
27
|
end
|
28
28
|
|
29
|
+
=begin this needs to be done at a mesh level
|
30
|
+
def tangent_and_bitangent
|
31
|
+
return [nil, nil] unless @a.kind_of?(TexturedVertex) && @b.kind_of?(TexturedVertex) && @c.kind_of?(TexturedVertex)
|
32
|
+
|
33
|
+
v1 = @a
|
34
|
+
v2 = @b
|
35
|
+
v3 = @c
|
36
|
+
|
37
|
+
w1 = @a.texcoord
|
38
|
+
w2 = @b.texcoord
|
39
|
+
w3 = @c.texcoord
|
40
|
+
|
41
|
+
x1 = v2.x - v1.x
|
42
|
+
x2 = v3.x - v1.x
|
43
|
+
y1 = v2.y - v1.y
|
44
|
+
y2 = v3.y - v1.y
|
45
|
+
z1 = v2.z - v1.z
|
46
|
+
z2 = v3.z - v1.z
|
47
|
+
|
48
|
+
s1 = w2.x - w1.x
|
49
|
+
s2 = w3.x - w1.x
|
50
|
+
t1 = w2.y - w1.y
|
51
|
+
t2 = w3.y - w1.y
|
52
|
+
|
53
|
+
r = 1.0 / (s1 * t2 - s2 * t1)
|
54
|
+
tangent += Geo3d::Vector.new (t2 * x1 - t1 * x2) * r, (t2 * y1 - t1 * y2) * r, (t2 * z1 - t1 * z2) * r
|
55
|
+
bitangent += Geo3d::Vector.new (s1 * x2 - s2 * x1) * r, (s1 * y2 - s2 * y1) * r, (s1 * z2 - s2 * z1) * r
|
56
|
+
|
57
|
+
end
|
58
|
+
=end
|
59
|
+
|
29
60
|
def signed_area reference_normal = Vector.new(0,0,-1)
|
30
61
|
sum = Vector.new 0, 0, 0, 0
|
31
62
|
points.each_with_index do |current_point, i|
|
File without changes
|
File without changes
|
data/lib/geo3d/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geo3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Misha Conway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,13 +94,13 @@ files:
|
|
94
94
|
- Rakefile
|
95
95
|
- geo3d.gemspec
|
96
96
|
- lib/geo3d.rb
|
97
|
+
- lib/geo3d/matrix.rb
|
98
|
+
- lib/geo3d/plane.rb
|
99
|
+
- lib/geo3d/quaternion.rb
|
100
|
+
- lib/geo3d/triangle.rb
|
101
|
+
- lib/geo3d/utils.rb
|
102
|
+
- lib/geo3d/vector.rb
|
97
103
|
- lib/geo3d/version.rb
|
98
|
-
- lib/matrix.rb
|
99
|
-
- lib/plane.rb
|
100
|
-
- lib/quaternion.rb
|
101
|
-
- lib/triangle.rb
|
102
|
-
- lib/utils.rb
|
103
|
-
- lib/vector.rb
|
104
104
|
- spec/lib/matrix_spec.rb
|
105
105
|
- spec/lib/plane_spec.rb
|
106
106
|
- spec/lib/quaternion_spec.rb
|