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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3462d13ff5931e068cd063b2bfeafe32a2f4b17
4
- data.tar.gz: 1e9791d44fb25bd1f490a60240ca6136fa464cdd
3
+ metadata.gz: 28094cb127ac5c0a2c4a01b210ad4d265205d109
4
+ data.tar.gz: 5f787ed19f07201aed9d4dda6a1d4d4ac4918086
5
5
  SHA512:
6
- metadata.gz: 945c70f63e01ef6be80054858899c924e383d116148b6e2b4a6b9ac7b3f24d684d6d283bd80a929fb66dec62a161942ed2f0b6334394317465a86c2bdb1965b4
7
- data.tar.gz: a69c83d5ad537b48d77eff2441bd89889bf4066557bdfda975af972cbcfc57b1c6ab8cac449261ff79a1e5f10bbfff6f9892a542ec83ce79d5fcbf56b3062817
6
+ metadata.gz: 12af94d86202307720d2461f0d6ac5ada0185247f66149707595354b47d9618fc57144b831fe0af3b97dc190b5c0cca8cd1a16ad3c529d62f12526ec66f8d8e3
7
+ data.tar.gz: 2dd6dc08fa562f43478f091e9cd0ff8774abd2a074120cc2b621a9df411e7c392e9a0bc52bc9f0096b3fd83beee7a059ced354d2c339be086fe96264d537dfc2
@@ -1,8 +1,9 @@
1
1
  require 'geo3d/version'
2
- require 'vector'
3
- require 'matrix'
4
- require 'quaternion'
5
- require 'plane'
6
- require 'triangle'
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
 
@@ -1,5 +1,3 @@
1
- require 'utils'
2
-
3
1
  module Geo3d
4
2
  class Matrix
5
3
  attr_accessor :_11, :_12, :_13, :_14
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
@@ -1,3 +1,3 @@
1
1
  module Geo3d
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-22 00:00:00.000000000 Z
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