mittsu 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -5
- data/appveyor.yml +23 -0
- data/install_glfw.ps1 +11 -0
- data/lib/mittsu/loaders/image_loader.rb +7 -10
- data/lib/mittsu/materials/mesh_basic_material.rb +3 -2
- data/lib/mittsu/renderers/opengl/objects/mesh.rb +1 -1
- data/lib/mittsu/version.rb +1 -1
- data/mittsu.gemspec +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14853ca4b6cc897edcdba73d196cc99ad2d80c9d
|
4
|
+
data.tar.gz: 857d141324a406aa0e420bbc0a0685348b373c5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a85835765393ad611593a0cfb1980518edf6a1bb4e38d331fe5d6033323d6b4fada55f1daefab7f39badad07150446f51db732b4f12beff8acca56e53fbc59d
|
7
|
+
data.tar.gz: 45463c3e8276ca92a07965d117d3749a53202c16d99e8d810c13441d53e509325d08147ada69fe93904a7cde5b6d2f3b326e58be5f7d342f2766adfc40e2a4b7
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Mittsu
|
2
2
|
|
3
|
-
[](https://badge.fury.io/rb/mittsu) [](https://gemnasium.com/jellymann/mittsu) [](https://circleci.com/gh/jellymann/mittsu/tree/master) [](https://codeclimate.com/github/jellymann/mittsu/coverage) [](https://codeclimate.com/github/jellymann/mittsu)
|
3
|
+
[](https://badge.fury.io/rb/mittsu) [](https://gemnasium.com/jellymann/mittsu) [](https://circleci.com/gh/jellymann/mittsu/tree/master) [](https://ci.appveyor.com/project/jellymann/mittsu/branch/master) [](https://codeclimate.com/github/jellymann/mittsu/coverage) [](https://codeclimate.com/github/jellymann/mittsu)
|
4
4
|
|
5
5
|
3D Graphics Library for Ruby
|
6
6
|
|
@@ -16,17 +16,22 @@ Mittsu makes 3D graphics easier by providing an abstraction over OpenGL, and is
|
|
16
16
|
|
17
17
|
Install the prerequisites:
|
18
18
|
|
19
|
-
Mittsu depends on Ruby 2.x, OpenGL 3.3+, GLFW 3.1.x
|
19
|
+
Mittsu depends on Ruby 2.x, OpenGL 3.3+, and GLFW 3.1.x
|
20
20
|
|
21
21
|
```bash
|
22
22
|
# OSX
|
23
|
-
$ brew install glfw3
|
23
|
+
$ brew install glfw3
|
24
24
|
|
25
25
|
# Ubuntu
|
26
|
-
$ sudo apt-get install libglfw3-dev
|
26
|
+
$ sudo apt-get install libglfw3-dev
|
27
27
|
```
|
28
28
|
|
29
|
-
**NOTE
|
29
|
+
**NOTE:** On Windows, you will have to manually specify the glfw3.dll path in an environment variable
|
30
|
+
(you can download it [here](http://www.glfw.org/download.html))
|
31
|
+
```bash
|
32
|
+
> set MITTSU_LIBGLFW_PATH=C:\path\to\glfw3.dll
|
33
|
+
> ruby your_awesome_mittsu_app.rb
|
34
|
+
```
|
30
35
|
|
31
36
|
Add this line to your application's Gemfile:
|
32
37
|
|
data/appveyor.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
|
3
|
+
clone_folder: c:\projects\mittsu
|
4
|
+
|
5
|
+
environment:
|
6
|
+
MITTSU_LIBGLFW_FILE: c:\projects\mittsu\glfw-3.2.1.bin.WIN32\lib-mingw\glfw3.dll
|
7
|
+
|
8
|
+
install:
|
9
|
+
- ps: c:\projects\mittsu\install_glfw.ps1
|
10
|
+
- set PATH=C:\Ruby22\bin;%PATH%
|
11
|
+
- bundle install
|
12
|
+
|
13
|
+
build: off
|
14
|
+
|
15
|
+
|
16
|
+
before_test:
|
17
|
+
- dir c:\projects\mittsu\glfw-3.2.1.bin.WIN32
|
18
|
+
- ruby -v
|
19
|
+
- gem -v
|
20
|
+
- bundle -v
|
21
|
+
|
22
|
+
test_script:
|
23
|
+
- bundle exec rake test
|
data/install_glfw.ps1
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Invoke-WebRequest https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN32.zip -OutFile "$pwd\glfw-3.2.1.bin.WIN32.zip"
|
2
|
+
|
3
|
+
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
4
|
+
function Unzip
|
5
|
+
{
|
6
|
+
param([string]$zipfile, [string]$outpath)
|
7
|
+
|
8
|
+
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
|
9
|
+
}
|
10
|
+
|
11
|
+
Unzip "$pwd\glfw-3.2.1.bin.WIN32.zip" "$pwd"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'chunky_png'
|
2
2
|
require 'mittsu/extras/image'
|
3
3
|
|
4
4
|
module Mittsu
|
@@ -11,18 +11,15 @@ module Mittsu
|
|
11
11
|
|
12
12
|
def load(url, flip: false, flop: false)
|
13
13
|
chache_url = "#{url}?flip=#{flip}&flop=#{flop}"
|
14
|
-
cached = Cache.get(
|
14
|
+
cached = Cache.get(chache_url )
|
15
15
|
return cached unless cached.nil?
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
rgba_data =
|
21
|
-
i.format = "RGBA"
|
22
|
-
i.depth = 8
|
23
|
-
}
|
17
|
+
png_image = ChunkyPNG::Image.from_file(url)
|
18
|
+
png_image = png_image.flip_vertically if flip
|
19
|
+
png_image = png_image.flip_horizontally if flop
|
20
|
+
rgba_data = png_image.to_rgba_stream
|
24
21
|
|
25
|
-
image = Image.new(
|
22
|
+
image = Image.new(png_image.width, png_image.height, rgba_data)
|
26
23
|
|
27
24
|
Cache.add(url, image)
|
28
25
|
@manager.item_start(url)
|
@@ -33,9 +33,10 @@ require 'mittsu/materials/material'
|
|
33
33
|
# fog: <bool>
|
34
34
|
# }
|
35
35
|
module Mittsu
|
36
|
-
attr_accessor :color, :map, :light_map, :specular_map, :alpha_map, :env_map, :combine, :reflectivity, :refraction_ratio, :shading, :wireframe, :wireframe_linewidth, :wireframe_linecap, :wireframe_linejoin, :vertex_colors, :skinning, :morph_targets, :fog
|
37
|
-
|
38
36
|
class MeshBasicMaterial < Material
|
37
|
+
|
38
|
+
attr_accessor :color, :map, :light_map, :specular_map, :alpha_map, :env_map, :combine, :reflectivity, :refraction_ratio, :shading, :wireframe, :wireframe_linewidth, :wireframe_linecap, :wireframe_linejoin, :vertex_colors, :skinning, :morph_targets, :fog
|
39
|
+
|
39
40
|
def initialize(parameters = {})
|
40
41
|
super()
|
41
42
|
|
@@ -7,7 +7,7 @@ module Mittsu
|
|
7
7
|
|
8
8
|
# wireframe
|
9
9
|
if material.wireframe
|
10
|
-
@renderer.state.set_line_width(material.wireframe_linewidth * @pixel_ratio)
|
10
|
+
@renderer.state.set_line_width(material.wireframe_linewidth * @renderer.pixel_ratio)
|
11
11
|
|
12
12
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, geometry_group.line_buffer) if update_buffers
|
13
13
|
glDrawElements(GL_LINES, geometry_group.line_count, type, 0)
|
data/lib/mittsu/version.rb
CHANGED
data/mittsu.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.add_runtime_dependency 'opengl-bindings', "~> 1.5"
|
28
28
|
spec.add_runtime_dependency 'ffi', "~> 1.9"
|
29
|
-
spec.add_runtime_dependency '
|
29
|
+
spec.add_runtime_dependency 'chunky_png', "~> 1.3"
|
30
30
|
|
31
31
|
spec.add_development_dependency "bundler", "~> 1.9"
|
32
32
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mittsu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opengl-bindings
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.9'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: chunky_png
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.3'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,9 +154,11 @@ files:
|
|
154
154
|
- LICENSE.txt
|
155
155
|
- README.md
|
156
156
|
- Rakefile
|
157
|
+
- appveyor.yml
|
157
158
|
- bin/console
|
158
159
|
- bin/setup
|
159
160
|
- circle.yml
|
161
|
+
- install_glfw.ps1
|
160
162
|
- lib/mittsu.rb
|
161
163
|
- lib/mittsu/cameras.rb
|
162
164
|
- lib/mittsu/cameras/camera.rb
|
@@ -381,7 +383,7 @@ requirements:
|
|
381
383
|
- ImageMagick 6.4.9 or later
|
382
384
|
- OpenGL 3.3+ capable hardware and drivers
|
383
385
|
rubyforge_project:
|
384
|
-
rubygems_version: 2.5.
|
386
|
+
rubygems_version: 2.5.2
|
385
387
|
signing_key:
|
386
388
|
specification_version: 4
|
387
389
|
summary: 3D Graphics Library for Ruby
|