AR: Cinema 4D R11 Collada export to Papervision with transparent textures


Print out this marker: http://inlovewith.com/inspiration/uploads/ar_collada_demo/assets/marker_A4.psd

Here is a way to load Collada files exported from Cinema 4D R11 into Papervision 2.0, with optionally transparent transparent textures.

To spice it up, the example is a AR, augmented reality project.

Step 1: SAVING OUT THE COLLADA
So, you have a Cinema 4D file that looks all nice.
# Click on each object and hit “c” to make the object editable. The icon should change to a triangle.

Now your file is ready for Collada export.
- Choose File -> export -> COLLADA
- Save as model.dae in the model folder (make a backup before if you like)
- Check all the checkboxes in the COLLADA export dialog that comes up once you click save

As you will notice no textures will be saved out. You’ll have to do this manually for each texture.

Step 2: EXPORTING THE TEXTURES AS (transparent) PNG FILES
First, click the materials and in the Tag propery, make sure you use UVW Mapping

Right-click on an object and choose Cinema 4D Tags -> Bake Texture
In the bake texture tag properties window:
- click on the […] and choose a file name for your texture. Use the same as the object’s name, so cylinder for our first object, and make sure to navigate to the model folder.
- Choose PNG as format
- Choose automatic size

In the bake texture options window:
- Choose surface color
- Click Bake

Now your texture has been saved as cylinderSurface_Color.png in the model folder.
Do the same for the cylinder.

You will now have the files cubeSurface_Color.png and cylinderSurface_Color.png. Rename them to cube.png and cylinder.png

These textures have been saved out without transparency. I don’t know any way to do this, if you know, please comment!

Open cube.png in Photoshop, make it transparent and green and save it (still as a PNG).

Step 3: CONNECTING THE TEXTURES WITH THE MODELS IN FLASH
1
Open model.dae in a text editor. Scroll down to the end, there we can find our Cylinder and Cube. Locate the tag and make a note of the target=”#IDXXX” attribute. This is the id we’ll use to connect the materials.

2
Open the main.fla and the main.as files in Flash. Here you can see how we load the two textures and map them to ID5 and ID3 which we took from the collada file.

var materials:MaterialsList = new MaterialsList();

var cylinderMaterial:BitmapFileMaterial = new BitmapFileMaterial(”model/cylinder.png”);
cylinderMaterial.doubleSided = true;
materials.addMaterial(cylinderMaterial, “ID5″);

var cubeMaterial:BitmapFileMaterial = new BitmapFileMaterial(”model/cube.png”);
cubeMaterial.doubleSided = true;
materials.addMaterial(cubeMaterial, “ID3″);

daeFile = new DAE();
daeFile.load(”model/model.dae”, materials);
daeFile.scaleX = daeFile.scaleY = daeFile.scaleZ = 0.5; // change for your model
daeFile.z = 100;
_markerNode.addChild(daeFile);

Now export (Apple+Enter) and watch the miracle. Make sure you print out the marker located in assets/marker_A4.psd and hold it up to your webcam.

This might not give the complete picture, there can be 100ds of variables affecting this kind of work, but hopefully it will get you up and running. It took me four days to get here, so I wanted to share it, as it was almost impossible to find any info on the subject.

Download source here: http://www.inlovewith.com/inspiration/uploads/AR_collada_tutorial.zip 2.6 mb

Posted at 2pm on 2/14/10 | no comments; | Filed Under: Uncategorized | read on

Wonderfl - Animation reacting to microphone input

Hmm, the embed from Wonderfl does not seem to work great in Safari, so try this one in Firefox or o see it at http://wonderfl.kayac.com/code/d7054539363ebe161469dfc718bb056d5ca63be5

forked from: Tween reacting on microphone, forked from: 光る玉 - wonderfl build flash online
Posted at 10pm on 4/11/09 | no comments; | Filed Under: Uncategorized | read on

Wonderfl - Springs

forked from: particle - wonderfl build flash online
Posted at 10pm on 4/11/09 | no comments; | Filed Under: Uncategorized | read on

Our work copied?

Take a minute to compare these lovely sites:
InspiroConsulting.se created by us jan 2008
Onitsuka Tiger Made Of Japan created by us in 2007
vs.
TagGalaxy.de created by Steven Wood may 2008.

The globe is copied from our Inspiro site, and to have tagged images from Flickr falling down on a design element is copied (a little more subtle i guess) from our Made Of Japan site

I rest my case

Posted at 5pm on 5/14/08 | no comments; | Filed Under: Uncategorized | read on

View – A nice Flickr image viewer

Having never seen a great image browser on the net, this is an attempt to create one. It’s an early version, so you can’t change album or user, but it’s a very nice way of browsing Flickr images.

view.jpg

Try it out here

Posted at 12am on 4/28/08 | no comments; | Filed Under: Uncategorized | read on

Ragdoll Test

In a current project we’ll use ragdoll physics, here’s the first test. Uses Box2D. Graphics was thrown together in 15 minutes.


Fullscreen

Posted at 9pm on 4/15/08 | no comments; | Filed Under: Uncategorized | read on

Life Path

See the path of your life


Fullscreen

Posted at 10pm on 3/26/08 | no comments; | Filed Under: Uncategorized | read on

Falling Photos

This component we’ll probably use to show some stuff in a new project we are working on. Drop us a line if you want to have a look at the source.


Fullscreen

Posted at 11pm on 3/20/08 | no comments; | Filed Under: Uncategorized | read on

Particles

I saw a really massive particle thingie made in processor. I tried to make a similar one with papervision for the 3d, and the great WOWEngine for 3d physics. If you look close you can sometimes see the particles hitting one and other and bounce away.


Fullscreen

This is basically th same but with random colors and longer trails.


Fullscreen

Get the source here

Posted at 2am on 2/24/08 | no comments; | Filed Under: papervision, wowengine, particles, effects, as3, source code, download | read on

About

It’s all about the inspiration, just post anything you find interesting. Just anything, don’t censur yourself.

Categories