tengo este sencillo cubo de color verde pistacho
DAE
Código :
<?xml version="1.0" encoding="utf-8"?> <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1"> <asset> <contributor> <author>anguloMaderas</author> <authoring_tool>COLLADAMax NextGen; Version: 1.2.3; Platform: Win32; Configuration: Release Max2010</authoring_tool> </contributor> <created>2009-10-03T19:18:48</created> <modified>2009-10-03T19:18:48</modified> <unit name="millimeter" meter="0.001"/> <up_axis>Z_UP</up_axis> </asset> <library_effects> <effect id="verde"> <profile_COMMON> <technique sid="common"> <blinn> <emission> <color>0 0 0 1</color> </emission> <ambient> <color>0.4509804 0.7450981 0.2588235 1</color> </ambient> <diffuse> <color>0.4509804 0.7450981 0.2588235 1</color> </diffuse> <specular> <color>0.9 0.9 0.9 1</color> </specular> <shininess> <float>9.999999</float> </shininess> <reflective> <color>0 0 0 1</color> </reflective> <transparent opaque="A_ONE"> <color>1 1 1 1</color> </transparent> <transparency> <float>1</float> </transparency> </blinn> </technique> </profile_COMMON> <extra> <technique profile="3dsMaxNextGen"> <extended_shader> <apply_reflection_dimming>0</apply_reflection_dimming> <dim_level>0</dim_level> <falloff_type>0</falloff_type> <index_of_refraction>1.5</index_of_refraction> <opacity_type>0</opacity_type> <reflection_level>3</reflection_level> <wire_size>1</wire_size> <wire_units>0</wire_units> </extended_shader> <shader> <ambient_diffuse_lock>1</ambient_diffuse_lock> <ambient_diffuse_texture_lock>1</ambient_diffuse_texture_lock> <diffuse_specular_lock>0</diffuse_specular_lock> <soften>0.1</soften> <use_self_illum_color>0</use_self_illum_color> </shader> </technique> </extra> </effect> </library_effects> <library_materials> <material id="verde-material" name="verde-material"> <instance_effect url="#verde"/> </material> </library_materials> <library_geometries> <geometry id="geom-cubo" name="cubo"> <mesh> <source id="geom-cubo-positions"> <float_array id="geom-cubo-positions-array" count="24">-18.7935 -19.25754 0 18.7935 -19.25754 0 -18.7935 19.25754 0 18.7935 19.25754 0 -18.7935 -19.25754 34.33875 18.7935 -19.25754 34.33875 -18.7935 19.25754 34.33875 18.7935 19.25754 34.33875</float_array> <technique_common> <accessor source="#geom-cubo-positions-array" count="8" stride="3"> <param name="X" type="float"/> <param name="Y" type="float"/> <param name="Z" type="float"/> </accessor> </technique_common> </source> <source id="geom-cubo-normals"> <float_array id="geom-cubo-normals-array" count="72">0 0 -0.9999999 0 0 -1 0 0 -0.9999999 0 0 -1 0 0 0.9999999 0 0 1 0 0 0.9999999 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0</float_array> <technique_common> <accessor source="#geom-cubo-normals-array" count="24" stride="3"> <param name="X" type="float"/> <param name="Y" type="float"/> <param name="Z" type="float"/> </accessor> </technique_common> </source> <source id="geom-cubo-map-channel1"> <float_array id="geom-cubo-map-channel1-array" count="36">0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0</float_array> <technique_common> <accessor source="#geom-cubo-map-channel1-array" count="12" stride="3"> <param name="S" type="float"/> <param name="T" type="float"/> <param name="P" type="float"/> </accessor> </technique_common> </source> <vertices id="geom-cubo-vertices"> <input semantic="POSITION" source="#geom-cubo-positions"/> </vertices> <triangles material="verde_1" count="12"> <input semantic="VERTEX" source="#geom-cubo-vertices" offset="0"/> <input semantic="NORMAL" source="#geom-cubo-normals" offset="1"/> <input semantic="TEXCOORD" source="#geom-cubo-map-channel1" offset="2" set="1"/> <p>0 0 9 2 1 11 3 2 10 3 2 10 1 3 8 0 0 9 4 4 8 5 5 9 7 6 11 7 6 11 6 7 10 4 4 8 0 8 4 1 9 5 5 10 7 5 10 7 4 11 6 0 8 4 1 12 0 3 13 1 7 14 3 7 14 3 5 15 2 1 12 0 3 16 4 2 17 5 6 18 7 6 18 7 7 19 6 3 16 4 2 20 0 0 21 1 4 22 3 4 22 3 6 23 2 2 20 0</p> </triangles> </mesh> <extra> <technique profile="3dsMaxNextGen"> <max_box> <generateuvs>1</generateuvs> <height>34.33874</height> <heightsegments>1</heightsegments> <length>38.51508</length> <lengthsegments>1</lengthsegments> <width>37.58701</width> <widthsegments>1</widthsegments> </max_box> </technique> </extra> </geometry> </library_geometries> <library_lights> <light id="EnvironmentAmbientLight" name="EnvironmentAmbientLight"> <technique_common> <ambient> <color>0 0 0</color> </ambient> </technique_common> </light> </library_lights> <library_visual_scenes> <visual_scene id="MaxScene"> <node name="EnvironmentAmbientLight"> <instance_light url="#EnvironmentAmbientLight"/> </node> <node id="node-cubo" name="cubo"> <translate>14.84919 -19.48956 0</translate> <instance_geometry url="#geom-cubo"> <bind_material> <technique_common> <instance_material symbol="verde_1" target="#verde-material"/> </technique_common> </bind_material> </instance_geometry> </node> </visual_scene> </library_visual_scenes> <scene> <instance_visual_scene url="#MaxScene"/> </scene> </COLLADA>
sacado del 3dsmax, y este sencillo código de papervision siguiendo cualquiera de los tutoriales que podéis encontrar por ahí. Lo puse a girar, por enredar
AS3
Código :
package{
import flash.display.*;
import flash.events.*;
///// 3D ////////////////////////////////////////
import org.papervision3d.view.Viewport3D;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.objects.parsers.Collada;
/////////////////////////////////////////////////
public class PV3D extends Sprite{
private var viewport: Viewport3D;
private var scene: Scene3D;
private var camera: Camera3D;
private var renderer: BasicRenderEngine;
private var collada:Collada
public function PV3D():void{
viewport = new Viewport3D(550, 400, false, true);
addChild(viewport);
scene = new Scene3D();
camera = new Camera3D();
renderer = new BasicRenderEngine();
collada = new Collada("cubo_verde_mat.DAE",null,.05);
scene.addChild(collada);
addEventListener(Event.ENTER_FRAME, onEnterFrame,false,0,true);
function onEnterFrame(e:Event):void{
collada.rotationX+=4
collada.rotationY+=4
collada.rotationZ+=4
renderer.renderScene(scene, camera, viewport);
}
}// fin pv3d
}
}Esto es lo que me sucede al darle a test movie:
1-
output window del flash (cs4):
INFO: Papervision3D Public Beta 2.0 - Great White (December 3rd, 2008)
INFO: DisplayObject3D: EnvironmentAmbientLight
INFO: DisplayObject3D: cubo
WARNING: Collada material verde_1 not found.
2-
No se ve en el reproductor del flash, tengo que ir al navegador, y lo que me encuentro es el cubo renderizado como wireframe
3-
Si en lugar de usar el parser parsers.Collada utilizo parsers.DAE, la output es esta
INFO: Papervision3D Public Beta 2.0 - Great White (December 3rd, 2008)
y el cubo ni aparece.
Dudo que todos los tutariales de la red estén mal. Sería alguien tan amable de decirme dónde estoy metiendo la pata?
Danke
