Examples of PointLight


Examples of box2dLight.PointLight

  }
 
  void initPointLights() {
    clearLights();
    for (int i = 0; i < BALLSNUM; i++) {
      PointLight light = new PointLight(
          rayHandler, RAYS_PER_BALL, null, LIGHT_DISTANCE, 0f, 0f);
      light.attachToBody(balls.get(i), RADIUS / 2f, RADIUS / 2f);
      light.setColor(
          MathUtils.random(),
          MathUtils.random(),
          MathUtils.random(),
          1f);
      lights.add(light);
View Full Code Here

Examples of box2dLight.PointLight

  public void create() {
    camera = new OrthographicCamera(48, 32);
    camera.update();
    world = new World(new Vector2(0, -10), true);
    rayHandler = new RayHandler(world);
    new PointLight(rayHandler, 32);

  }
View Full Code Here

Examples of com.ardor3d.light.PointLight

                setPosition(index, record, -direction.getXf(), -direction.getYf(), -direction.getZf(), 0, lr);
                break;
            }
            case Point:
            case Spot: {
                final PointLight pointLight = (PointLight) light;
                final ReadOnlyVector3 location = pointLight.getLocation();
                setPosition(index, record, location.getXf(), location.getYf(), location.getZf(), 1, lr);
                break;
            }
        }
View Full Code Here

Examples of com.ardor3d.light.PointLight

                setPosition(index, record, -direction.getXf(), -direction.getYf(), -direction.getZf(), 0, lr);
                break;
            }
            case Point:
            case Spot: {
                final PointLight pointLight = (PointLight) light;
                final ReadOnlyVector3 location = pointLight.getLocation();
                setPosition(index, record, location.getXf(), location.getYf(), location.getZf(), 1, lr);
                break;
            }
        }
View Full Code Here

Examples of com.ardor3d.light.PointLight

        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        _root.setRenderState(ts);

        // Set up a basic, default light.
        final PointLight light = new PointLight();
        light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 0.75f, 0.75f));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(100, 100, 100));
        light.setEnabled(true);

        // Attach the light to a lightState and the lightState to rootNode.
        final LightState lightState = new LightState();
        lightState.setEnabled(true);
        lightState.attach(light);
View Full Code Here

Examples of com.ardor3d.light.PointLight

        lightSphere.setModelBound(new BoundingSphere());
        lightSphere.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        lightSphere.setDefaultColor(lightColor);

        // Create a new point light and fill out the properties
        final PointLight pointLight = new PointLight();
        pointLight.setAttenuate(true);
        pointLight.setConstant(.01f);
        pointLight.setLinear(.001f);
        pointLight.setQuadratic(.1f);
        pointLight.setEnabled(true);
        pointLight.setDiffuse(lightColor);
        pointLight.setAmbient(new ColorRGBA(.1f, .1f, .1f, .1f));

        _lightState.attach(pointLight);

        lightSphere.addController(new SpatialController<Spatial>() {

            double timeX = rand.nextDouble() * Math.PI * 8;
            double timeY = rand.nextDouble() * Math.PI * 8;
            double timeZ = rand.nextDouble() * Math.PI * 8;
            double speed = MathUtils.nextRandomDouble();

            public void update(final double tpf, final Spatial caller) {
                timeX += tpf * speed;
                timeY += tpf * speed;
                timeZ += tpf * speed;

                final double xPos = Math.sin(timeX * 0.4) * worldsize;
                final double yPos = Math.cos(timeY * 0.5) * worldsize;
                final double zPos = Math.sin(timeZ * 0.6) * worldsize;

                caller.setTranslation(xPos, yPos, zPos);
                pointLight.setLocation(xPos, yPos, zPos);
            }
        });

        // Add the light to the world part 2.
        colornode.attachChild(lightSphere);
View Full Code Here

Examples of com.ardor3d.light.PointLight

        buf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
        _root.setRenderState(buf);

        // ---- LIGHTS
        /** Set up a basic, default light. */
        light = new PointLight();
        light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 0.75f, 0.75f));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(100, 100, 100));
        light.setEnabled(true);

View Full Code Here

Examples of com.ardor3d.light.PointLight

        // Add a texture to the box.
        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        box.setRenderState(ts);

        final PointLight light = new PointLight();

        final Random random = new Random();

        final float r = random.nextFloat();
        final float g = random.nextFloat();
        final float b = random.nextFloat();
        final float a = random.nextFloat();

        light.setDiffuse(new ColorRGBA(r, g, b, a));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(MOVE_SPEED, MOVE_SPEED, MOVE_SPEED));
        light.setEnabled(true);

        /** Attach the light to a lightState and the lightState to rootNode. */
        final LightState lightState = new LightState();
        lightState.setEnabled(true);
        lightState.attach(light);
View Full Code Here

Examples of com.ardor3d.light.PointLight

    @Override
    protected void initExample() {
        importDogDae();

        p = new PointLight();
        p.setDiffuse(new ColorRGBA(0.75f, 0.65f, 0.65f, 0.65f));
        p.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        p.setEnabled(true);

        p.setLocation(Vector3.ZERO);
View Full Code Here

Examples of com.ardor3d.light.PointLight

        double distance = _minimumLightDistance;

        final Vector3 tmpVec = Vector3.fetchTempInstance();

        // Update shadow camera from light
        final PointLight pl = (PointLight) _light;

        shadowCam.setLocation(pl.getLocation());

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

        // Reset frustum
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.