kig / JSARToolKit

JavaScript port of FLARToolKit
http://fhtr.org/JSARToolKit
Other
690 stars 163 forks source link

Drawing on ARScene three.js #19

Closed Neuroforge closed 8 years ago

Neuroforge commented 8 years ago

Hello,

I want to add a line to the three.js scene,

        var material = new THREE.LineBasicMaterial({
            color: 0x0000ff
        });

        var geometry = new THREE.Geometry();
        geometry.vertices.push(new THREE.Vector3(-10, 0, 0));
        geometry.vertices.push(new THREE.Vector3(0, 10, 0));
        geometry.vertices.push(new THREE.Vector3(10, 0, 0));

        var line = new THREE.Line(geometry, material);

        arController.addEventListener('getMarker', function (ev) {
            console.log('found marker?', ev);
            var marker = ev["data"]["marker"];
            var vertex, pos;
            vertex = marker.vertex;

            var markerRoot = arController.createThreeMarker(marker);
            markerRoot.add(line);
            arScene.scene.add(line);

        });

This scene runs, but i do not see any lines on the screen?