kig / JSARToolKit

JavaScript port of FLARToolKit

Home Page:http://fhtr.org/JSARToolKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drawing on ARScene three.js

Neuroforge opened this issue · comments

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?