[Papervision3D] Papervision3D Google Sketchup Tips

John Dyer JDyer at dts.edu
Sat Apr 28 10:39:58 EDT 2007


John,
One of my best friends since college is Frank Barnett who worked IFL while you did their web stuff. He always talked about this awesome flash developer with a funny last name. I thought for sure you couldn't be the same John Grden!  
 
Regarding the notes below, perhaps Papervision's Collada object could be reworked a little to take the <lines> and <triangles> problem into consideration to make Sketchup work a little less manual.
 
---
Peter, here's some tips:
 
Papervision3D Google Sketchup Tips
- Getting a DAE out of Sketchup (Free version): Go to File->Export->3D Model and select Google Earth (KMZ). Save this file and unzip it (you might need to change the extension to .zip first depending on your unzip software). Inside the unzipped files, look in the models folder for your dae.
- Getting a DAE out of Google Sketchup Pro:  Go to File->Export->3D Model and select Collada (DAE). There are some options like whether or not to make all walls two sided (not needed) or including a camera node (not needed). Just make sure you do check "Triangulate all faces".
- Now that you have the DAE, you'll have to do some manual edits to get it to work. First, you need to go to the <library_geometries> node and look for any <geometry> nodes that don't have any <triangles>. I think Sketchup exports about the same number of <geometry> nodes with <triangle> and <geometry> nodes with <lines>. You need to get rid of all the ones with just <lines>. Usually these are all named "mesh1" "mesh2" ... 
- Second, you need to go to the <library_visual_scenes> node and find all the <node>s with the same name attribute as the <geometry> nodes you deleted. For example, if you kept mesh 1-9 and deleted 10-16, then also remove 10-16 in the <library_visual_scenes> node.
- Regarding Materials, I had a roof color and a wall color in my simple model. Unfortunately, Sketchup exports a different material for each triangle and my model had about 400. But Sketchup does name them similarly, so here's how I did the materials for papervision:
 
var myMaterials:Object = {};
var roof:ColorMaterial = new ColorMaterial(0xAF7359);
for (var i:Number=1; i<50; i++)
    myMaterials["Material1_" + i.toString() ] = roof;

var wall:ColorMaterial = new ColorMaterial(0xC7C1B3);
for (var i:Number=1; i<300; i++) 
    myMaterials["Material2_" + i.toString() ] = wall;
  
- one more thing: Sketchup models tend to be huge in terms of dimensions so be sure to back up your camera quite a bit!
 
Hope that helps someone... Sketchup is super easy for this kind of thing,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070428/b8c38485/attachment.htm


More information about the Papervision3D mailing list