This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

End project. Link to tutorial that explains how to use SketchUp model…

…s in Three.js with the new Collada loader
  • Loading branch information...
1 parent 3911c75 commit 79ba4daa4413bfa21067fea0acba50ad20c2bd7d @timjb committed Jan 14, 2012
Showing with 1 addition and 863 deletions.
  1. +0 −19 LICENSE
  2. +1 −15 README.md
  3. +0 −12 TODO.md
  4. +0 −10 export_threejs.rb
  5. +0 −160 export_threejs/ThreeCanvas.js
  6. +0 −43 export_threejs/array_set.rb
  7. +0 −48 export_threejs/dialog.html
  8. +0 −386 export_threejs/main.rb
  9. +0 −120 export_threejs/scene.js
  10. +0 −24 export_threejs/style.css
  11. +0 −26 export_threejs/test.rb
View
19 LICENSE
@@ -1,19 +0,0 @@
-Copyright (c) 2010-2011 Tim Baumann
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
View
@@ -1,15 +1 @@
-Installation
-------------
-
-Copy `export_threejs` and `export_threejs.rb` to
-
-* **Windows**: `C:\Program Files\Google\Google SketchUp 8\Plugins\`
-* **Linux** with [Wine](http://www.winehq.org/):
- `~/.wine/drive_c/Program Files/Google/Google SketchUp 8/Plugins/`
-* **Mac OS X**: `/Library/Application Support/Google SketchUp 8/SketchUp/plugins`
-
-
-Usage
------
-
-Choose `File` → `Export to Three.js`
+[https://github.com/mrdoob/three.js/wiki/Using-SketchUp-Models](https://github.com/mrdoob/three.js/wiki/Using-SketchUp-Models)
View
12 TODO.md
@@ -1,12 +0,0 @@
-* README.md
- * Screenshot
- * Bug reporting
- * Credits
-* Include models for test
-* Show what the program is doing (maybe with Sketchup.status_text=)
-* Option to export only the selected entities
-* Option to set or disable the caption
-* Option to turn textures off
-* Option to to choose wether to export the textures as standalone files or data urls (or do this automatically for large textures)
-* Example on GitHub pages
-* Improve performance
View
@@ -1,10 +0,0 @@
-require 'sketchup.rb'
-require 'extensions.rb'
-#require 'LangHandler.rb'
-
-export_threejs_extension = SketchupExtension.new "Export to Three.js", "export_threejs/main.rb"
-export_threejs_extension.creator = "Tim Baumann"
-export_threejs_extension.version = "0.0.1"
-export_threejs_extension.copyright = "MIT License"
-export_threejs_extension.description = "Export your models to a webpage. You can freely rotate them in all directions."
-Sketchup.register_extension export_threejs_extension, true

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,43 +0,0 @@
-module ExportThreeJS
-
- # ArraySet
- # ========
- #
- # This is a kind of crossover between sets and arrays. It has only two methods:
- #
- # * push -- adds a value to the ArraySet if the array set doesn't include
- # it already and returns the index of that value
- # * to_a -- converts the ArraySet to a real array
- #
- # Example:
- #
- # as = ArraySet.new
- # as.push 1 # => 0
- # as.push 4 # => 1
- # as.push 1 # => 0
- # as.push 5 # => 2
- # as.to_a # => [1,4,5]
-
- class ArraySet
- def initialize
- @hash = Hash.new
- @array = []
- end
-
- def push o
- if @hash.include? o
- @hash[o]
- else
- i = @array.size
- @array.push o
- @hash[o] = i
- i
- end
- end
-
- def to_a
- @array
- end
- end
-
-end
View
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
- <meta charset="utf-8" />
- <title>Export to Three.js</title>
- <style>
- * { margin: 0; padding: 0; }
- body {
- font: 14px Helvetica, Arial, sans-serif;
- padding: 10px;
- }
- </style>
-</head>
-
-<body>
- <form>
- <p>
- <label><input name="type-radio" id="type-html" type="radio" value="html" checked="checked" /> Whole Webpage</label>
- <br />
- <label><input name="type-radio" id="type-js" type="radio" value="js" /> Just the JavaScript</label>
- <input type="hidden" id="type" name="type" value="html" />
- <p>
- </form>
-
- <script>
- var byId = function(id) { return document.getElementById(id); };
-
- // Whenever the state of a `[name=type-radio]` radio button changes, set the
- // value of the hidden input field `#type`. The value of the hidden field
- // can then be easily read from Ruby.
- (function() {
- var hiddenInput = byId('type');
-
- var typeHtml = byId('type-html');
- typeHtml.onclick = function() {
- hiddenInput.value = 'html';
- };
-
- var typeJs = byId('type-js');
- typeJs.onclick = function() {
- hiddenInput.value = 'js';
- };
- })();
- </script>
-</body>
-
-</html>
Oops, something went wrong.

2 comments on commit 79ba4da

plugin is not working :/

Owner

timjb replied May 6, 2014

That's correct. It's not working because I'm not working on it anymore. If you want to use your Sketchup model in Three.js, you should export your model to Collada and then use the Collada loader, as described in this short tutorial.

Please sign in to comment.