How to add custom 3D object to awe.js?

I am trying to add a custom 3D object to awe.js, I tried with cubes and a geometry sphere but couldn't find any documentation that makes it easier to add a 3d object. Any ideas?

  awe.projections.add({ 
		          id:'n', 
		          geometry:{ path:'cube.obj'}, 
				  rotation:{ x:30, y:30, z:0 },
		          material:{ 
		          type: 'phong',
		          color:0x000000, 
		          },
		        }, { poi_id: 'north' });
      

Run codeHide result


+3


source to share


1 answer


using new libraries you can do it like below, i copied this from my answer in another question ( awe.js augmented reality add text ).



awe.pois.add({ id:'jsartoolkit_marker_64', position: { x:0, y:0, z:0 }, scale: { x: 1, y: 1, z: 1 } });
                awe.projections.add({ 
                              id:'marker_projection', 
                                    geometry: { path: 'models/obj/example.obj' }, // path to your model
                                    position: { x: 0, y: 0, z: 0 },
                                    rotation: { x: 0, y: 180, z: 0 },
                                    material:{ path: 'models/obj/example.mtl' }, // path to material if you're using one
                                    visible: false,
}, { poi_id: 'jsartoolkit_marker_64' }); // common point of interest, in this case the marker 

      

+2


source







All Articles