2016-12-07 12 views
2

私はこのチュートリアルを使用して、テキストをawe.jsプロジェクトに追加しようとしています。私は試しに、https://www.sitepoint.com/augmented-reality-in-the-browser-with-awe-js/を考え出しました。awe.js現実的なテキストの追加

awe.projections.add({ 
    id: 'text', 
    geometry: {shape: 'text', text: 'Hello World', font: 'times new roman', weight: 'normal', style: 'normal'}, 
    rotation: {y: 45}, 
    position: {x: -5, y: -31, z: -5}, 
    material: { 
     type: 'phong', 
     color: 0xFF0000 
    } 
}, {poi_id: 'marker'}); 

次に、私はこのテーマについてさらに研究を重ね、異なる方法で試しましたが、まだ成功しませんでした。

awe.pois.add({ id:'fixed_poi', position: { x:70, y:0, z:-250 }, visible: true }); 
        awe.projections.add({ 
         id:'fixed_projection', 
           geometry: { shape: 'text', text: "My Text", parameters:{font: 'optimer', size: 50}}, 
       position: { x:0, y:0, z:0 }, 
       rotation: { x:0, y:0, z:0 }, 
         material:{ type: 'phong', color: 0xFFFFFF }, 
        }, { poi_id: 'fixed_poi' }); 

答えて

0

は、Windows 10で3Dビルダー、例えば別途(.OBJ 3Dモデル)をテキストモデルを作成し、以下の方法ででawe.jsにそれを追加することができます。

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 

・ホープ、この助けてください

関連する問題