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
About this entry
You’re currently reading “ AR: Cinema 4D R11 Collada export to Papervision with transparent textures ,” an entry on THYSELIUS & WISTROM
- Published:
- 2.14.10 / 2pm
- Category:
- Uncategorized
No comments
Jump to comment form | comments rss [?]