Examples of lookAt()


Examples of com.ardor3d.renderer.Camera.lookAt()

            _controlHandle.setUpAxis(upAxis);

            final Camera cam = _canvas.getCanvasRenderer().getCamera();
            cam.setLocation(vec);
            cam.lookAt(center, upAxis);
            final double near = Math.max(radius / 50.0, 0.25);
            final double far = Math.min(radius * 5, 10000.0);
            cam.setFrustumPerspective(50.0, cam.getWidth() / (double) cam.getHeight(), near, far);
            cam.update();

View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

    protected void initExample() {
        // Setup main camera.
        _canvas.setTitle("Terrain Example");
        final Camera canvasCamera = _canvas.getCanvasRenderer().getCamera();
        canvasCamera.setLocation(new Vector3(2176, 790, 688));
        canvasCamera.lookAt(new Vector3(canvasCamera.getLocation()).addLocal(-0.87105768019686, -0.4349655341112313,
                0.22817427967541867), Vector3.UNIT_Y);
        canvasCamera.setFrustumPerspective(45.0, (float) _canvas.getCanvasRenderer().getCamera().getWidth()
                / _canvas.getCanvasRenderer().getCamera().getHeight(), 1.0f, farPlane);
        final CanvasRenderer canvasRenderer = _canvas.getCanvasRenderer();
        final RenderContext renderContext = canvasRenderer.getRenderContext();
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

        });

        // set camera
        final Camera cam = _canvas.getCanvasRenderer().getCamera();
        cam.setLocation(280, 372, -280);
        cam.lookAt(new Vector3(250, 350, -280), Vector3.UNIT_Y);
        cam.setFrustumPerspective(50.0, cam.getWidth() / (double) cam.getHeight(), .25, 900);
        cam.update();

        // speed up wasd control a little
        _controlHandle.setMoveSpeed(200);
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

        });

        // set camera
        final Camera cam = _canvas.getCanvasRenderer().getCamera();
        cam.setLocation(197, 113, -126);
        cam.lookAt(new Vector3(157, 91, -174), Vector3.UNIT_Y);
        cam.setFrustumPerspective(45.0, cam.getWidth() / (double) cam.getHeight(), .25, 900);
        cam.update();

        // speed up wasd control a little
        _controlHandle.setMoveSpeed(200);
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

        });

        // set camera
        final Camera cam = _canvas.getCanvasRenderer().getCamera();
        cam.setLocation(280, 372, -280);
        cam.lookAt(new Vector3(250, 350, -280), Vector3.UNIT_Y);
        cam.setFrustumPerspective(50.0, cam.getWidth() / (double) cam.getHeight(), .25, 900);
        cam.update();

        // speed up wasd control a little
        _controlHandle.setMoveSpeed(200);
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

    @Override
    protected void initExample() {
        _canvas.setTitle("Terrain Example");
        final Camera cam = _canvas.getCanvasRenderer().getCamera();
        cam.setLocation(new Vector3(440, 215, 275));
        cam.lookAt(new Vector3(450, 140, 360), Vector3.UNIT_Y);
        cam.setFrustumPerspective(70.0, (float) cam.getWidth() / cam.getHeight(), 1.0f, farPlane);
        final CanvasRenderer canvasRenderer = _canvas.getCanvasRenderer();
        final RenderContext renderContext = canvasRenderer.getRenderContext();
        final Renderer renderer = canvasRenderer.getRenderer();
        GameTaskQueueManager.getManager(renderContext).getQueue(GameTaskQueue.RENDER).enqueue(new Callable<Void>() {
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

        tmpVec.multiplyLocal(distance);
        tmpVec.addLocal(center);

        // temporary location
        shadowCam.setLocation(tmpVec);
        shadowCam.lookAt(center, Vector3.UNIT_Y);

        {
            // determine
            final double texelSizeW = (2 * radius) / _shadowMapRenderer.getWidth();
            final double texelSizeH = (2 * radius) / _shadowMapRenderer.getHeight();
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

        final PointLight pl = (PointLight) _light;

        shadowCam.setLocation(pl.getLocation());

        // Point light at split center
        shadowCam.lookAt(center, Vector3.UNIT_Y);

        // Reset frustum
        distance = center.subtract(shadowCam.getLocation(), tmpVec).length();
        shadowCam.setFrustum(1, distance, -1, 1, 1, -1);
View Full Code Here

Examples of com.ardor3d.renderer.Camera.lookAt()

        position.set((fMinX + fMaxX) * 0.5, (fMinY + fMaxY) * 0.5, 1.0, 1);
        shadowCam.getModelViewProjectionInverseMatrix().applyPre(position, position);
        position.divideLocal(position.getW());
        newCenter.set(position.getX(), position.getY(), position.getZ());

        shadowCam.lookAt(newCenter, Vector3.UNIT_Y);

        Vector3.releaseTempInstance(newCenter);
        Vector4.releaseTempInstance(position);

        shadowCam.setFrustum(fMinZ, fMaxZ, -width, width, height, -height);
View Full Code Here

Examples of com.jme.math.Quaternion.lookAt()

        Quaternion rotation = cell.getWorldTransform().getRotation(null);
        Vector3f lookVec = CellPlacementUtils.getLookDirection(rotation, null);

        // translate into a quaternion using lookAt
        Quaternion look = new Quaternion();
        look.lookAt(lookVec.negate(), Vector3f.UNIT_Y);

        // find the origin by translating the look vector
        Vector3f origin = lookVec.mult(distance);
        origin.addLocal(cell.getWorldTransform().getTranslation(null));
        return new CellTransform(look, origin);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.