vujadin / BabylonHx

Port of Babylon.js 3D engine to Haxe.
http:/paradoxplay.com/babylonhx
Apache License 2.0
189 stars 43 forks source link

WebVRFreeCamera #108

Closed maitag closed 8 years ago

maitag commented 8 years ago

Hello

since commit "preparing for ctm support ": https://github.com/vujadin/BabylonHx/commit/27b96a3c73d32dd7132f022abbae4985af04a921

WebVRFreeCamera did not work anymore (only black screen output) .

vujadin commented 8 years ago

can you test in browser and check console for error ?

vujadin commented 8 years ago

I've just tried this and it works for both js and cpp builds;

public function new(scene:Scene) {
        var camera = new WebVRFreeCamera("camera1", new Vector3(0, 5, -10), scene);
        camera.setTarget(Vector3.Zero());
        camera.attachControl();

        var light = new HemisphericLight("light1", new Vector3(1, 0.5, 0), scene);
        light.intensity = 0.7;

        var sphere = Mesh.CreateSphere("sphere1", 16, 2, scene);
        sphere.position.y = 1;

        var ground = Mesh.CreateGround("ground1", 6, 6, 2, scene);

        scene.getEngine().runRenderLoop(function () {
            scene.render();
        });
    }