【问题标题】:How to add a custom 3d object in awe.js?如何在 awe.js 中添加自定义 3d 对象?
【发布时间】:2015-06-02 00:54:39
【问题描述】:

我正在尝试在 awe.js 中添加自定义 3d 对象,我尝试过使用立方体和球体几何形状,但没有找到任何有助于添加 3d 对象的文档。有什么想法吗?

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

【问题讨论】:

  • 你找到方法了吗?

标签: javascript 3d


【解决方案1】:

您可以使用新库,如下所示,我已经从另一个问题 (awe.js Augmented Reality adding 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 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 1970-01-01
    • 2021-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-17
    相关资源
    最近更新 更多