Imported .dae file not showing properly

What I am trying to do is export from Blender a .dae file of an animated object and then import this file on processing and use it there. I created a rotating cube, baked action and exported it as .dae file. the problem is when I am importing it on processing the animation doesn’t work and I can see only a square. My code is the following:

import ch.dieseite.colladaloader.ColladaLoader;
import ch.dieseite.colladaloader.wrappers.ColladaModel;

ColladaModel model;

void setup() {
  size(500,600,P3D);
  background(255);
  lights();
  frameRate(10);
  model = ColladaLoader.load("cuberot.dae", this, null);
  model.scale(25);
}

void draw() {
  translate(width/2,height/2);
  model.draw(); 
}

Can someone explain how can I make this to work? Also why I have to scale my object in order to see it properly? if don’t the object is like a pixel.

If anyone knows another library for doing that job I am all ears. Thanks.

1 Like

see for add info also

and

http://www.die-seite.ch/?colladaloader


possibly model work in a number range 0 … 1.0
processing in 0 … width pix
so using a scale looks very good.


sorry i can not answer your question, just added two links your post missed,
hopefully you find someone here who has used that old (2015) library
Or has a better idea how to do it.

1 Like

The first one is also my question without any reply yet. The second link is the one that I followed but I don’t understand what I am doing wrong.

Maybe you know some newer library that I can use? My search gave me this as a good result I know its an old one. Thank you.

Hi @agp,

Observing the dimensions of your cube in Blender will answer this question:

Also why I have to scale my object in order to see it properly? if don’t the object is like a pixel

blendCube

Blender’s world coordinate system, origin and units of measurement are different than Processing’s.

A default cube in Blender is 2m. It is centered at (0, 0, 0). z is the up axis. Each vertex of the cube is a variant of (+/- 1, +/- 1, +/- 1).

Processing’s default camera looks at (width / 2, height / 2, 0). y is the down axis. This is for parity between 2D and 3D I guess.

If you don’t want to scale in Processing, you could scale the object transform or the mesh data in Blender. You could also change Processing’s camera and projection.

Best,
Jeremy

3 Likes

No one knows anything about the library?

Hi @agp,

Without being able to see the cube animation, it might help to share some background. Why did you decide to create an animation in Blender, then choose Processing as the export target? Is your ultimate goal a non-interactive animation or an interactive app?

What would the library need to be able to do even after the .dae was imported to cover the differences between Processing and Blender’s animation systems? It helps to have a specific list, because then you can search a library’s documentation and see if it has what you need.

When you say you’re rotating a cube, do you mean you’re animating its transform? A lot of things can be assigned key frames in Blender, so it helps to be specific. What is the cube’s rotation mode?

rotationMode

I don’t know anything about the .dae file format, but IMO assuming you could find an up-to-date, well-documented Processing library, it would have to overhaul so much of Processing’s 3D API that you’d spend as much time learning how the library works as you would if you stuck with Blender, or if you exported to another 3D engine with a known animation system included (e.g., Unity).

If the geometry does not matter, only the animation does, you could try recreating the animation with box and rotate (which version(s) you use depend on the rotation mode you set in Blender). Anything more complicated than that and I expect you’d need a library which allowed you to ease between an array of transforms; a simplified example of what I mean, in JavaScript, is here.

That’s not an answer, but I hope it helps put some perspective on things.
Jeremy

4 Likes

try this idea:

go back blender
export the object only ( no animation (baked action) )
to .OBJ .MTL

and use it in processing by

PixelFlow

by Thomas Diewald

library.


sorry if it looks like double work

1 Like

Thank you for the information @behreajj,
I am quite new to Processing and some things are not so clear for me, the reason I decided to go with Blender is that I am more familiar with it. I would like to have an interactive app which enables an animation (not only one animation).
The cube was just an experiment to see if what I had in mind is working (obviously not). I am still trying to find out the best way to complete my task.
Again, thank you for the guidance. :slight_smile:

Thank you @kll,
I will check this out.