Currently, ColladaLoader can import dae or kmz files created by Blender or SketchUp. Next two chapters describe some rules about exporting dae files
Do / enshure following steps:
Consider following points:
The library has demo files they do all the same, but use different renderers. If your platform produce no errors using P3D then ViewerDefault is the right choice.
The examples give a quick start over all features/usage of this library. User should also read javadoc for classes "ColladaLoader" and "ColladaModel". Here is a short beginner sample:
import ch.dieseite.colladaloader.ColladaLoader; import ch.dieseite.colladaloader.wrappers.ColladaModel; ColladaModel model; void settings() { size(500,500,P3D); } void setup() { lights(); frameRate(10); model = ColladaLoader.load("sketchup.kmz",this,null); //notes: //- loader accepts kmz and dae file endings //- user can create unlimited numbers of models //- loader can process user options via 3rd param } void draw() { background(0); model.draw(); //notes: (see also javadoc) //- model can draw using default renderer (2D) or OpenGL (P2D/P3D) //- model can scale, move or rotate its 3D positions without changing rest of view }
User Options | ||
---|---|---|
Users can fine adjust colladaLoader's behavior as following:
import java.util.Properties; <...> Properties options = new Properties(); ColladaLoader.load("sketchup.kmz",this,options); <...> |
||
Key | Value | Affect |
option_no_texture | true | ColladaLoader uses Processing images (PImage) to display textures. If value is true then collada texture data is ignored and replaced by a dummy color. A useful debug tool on problems like "image file not found, unsupported image format, out of memory" etc. |
false (default) | textures is enabled | |
LinkingSchema | Sketchup (default) | A loading profile what consider the way how external 3D modeling applications export 3D data to collada. In other words: exported .dae files by SketchUp should use that value. |
Blender | Loads collada file via Blender profile | |
debuglevel | 0 to 4 | Verbose internal processes from
ColladaLoader to system console: 4 = extreme details 3 = details 2 = medium 1 = abstract 0 = none (default) |
GLAdapter is another way to run OpenGL /P3D. Both, Processing API and GLAdapter, use the same native libraries (JOGL) but obviously over different implementations . As Processing increased its version to 2.0 and higher my platform began to crash so I was forced to find a way to patch this bug. Let's suppose I'm not the only one with this issue I included this patch to colladaLoader package now.
GLAdapter emulates a selected part of Processing API (P3D). It has the same names , accepts the same input params and shows the same output behavior. But the performance is not very sexy. Every usage start with this sample stub:
import ch.dieseite.glemulator.GLAdapter; GLAdapter adapter; void settings(){ size(200, 200); //leave Processing in 2D } void setup(){ adapter = new GLAdapter(200, 200); } void draw(){ adapter.background(200);// An API example (see also list below) adapter.repaint(); //flush jobs, must ALWAYS be called at the end }
There exist a class "GLBaseTest" which creates some test shapes.
Following functions is supported by GLAdapter: