Package com.jme.renderer

Examples of com.jme.renderer.ColorRGBA


            String url = dialog.getServerURL();
            float x = dialog.getLocationX();
            float y = dialog.getLocationY();
            float z = dialog.getLocationZ();
            float angle = dialog.getLookAtAngle();
            ColorRGBA backColor = dialog.getBackgroundColor();
            ColorRGBA textColor = dialog.getTextColor();
            String imageURL = dialog.getImageURL();
            String message = dialog.getMessage();
            Placemark newPlacemark = new Placemark(name, url, x, y, z, angle, backColor, textColor,
                    imageURL, message);
View Full Code Here


    private void attachOuterOrb(Entity entity) {
        final Sphere outerOrb = new Sphere("Outer Orb", 16, 16, OUTER_RADIUS);
        outerOrb.setModelBound(new BoundingSphere());
        outerOrb.updateModelBound();
        ColorRGBA orbColour = new ColorRGBA(0f, 0f, 1f, 0.2f);
        MaterialState matState = (MaterialState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Material);
        matState.setDiffuse(orbColour);
        outerOrb.setRenderState(matState);

        BlendState bs = (BlendState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Blend);
View Full Code Here

  private static void getColorFromUser() {
    Color resultColor = JColorChooser.showDialog(null, "Choose the color of your sphere", Color.red);
    if(resultColor == null) {
      color = ColorRGBA.red.clone();
    }else {
      color = new ColorRGBA(resultColor.getRed(), resultColor.getGreen(), resultColor.getBlue(), resultColor.getAlpha());
    }
  }
View Full Code Here

  private void setupFog() {
    FogState fogState = display.getRenderer().createFogState();
    fogState.setDensity( 1.0f );
    fogState.setEnabled( true );
    fogState.setColor( new ColorRGBA( 1.0f, 1.0f, 1.0f, 1.0f ) );
    fogState.setEnd( farPlane );
    fogState.setStart( farPlane / 10.0f );
    fogState.setDensityFunction( FogState.DF_LINEAR );
    fogState.setApplyFunction( FogState.AF_PER_VERTEX );
    rootNode.setRenderState( fogState );
View Full Code Here

  private void setupFog() {
    FogState fogState = display.getRenderer().createFogState();
    fogState.setDensity( 1.0f );
    fogState.setEnabled( true );
    fogState.setColor( new ColorRGBA( 1.0f, 1.0f, 1.0f, 1.0f ) );
    fogState.setEnd( farPlane );
    fogState.setStart( farPlane / 10.0f );
    fogState.setDensityFunction( FogState.DF_LINEAR );
    fogState.setApplyFunction( FogState.AF_PER_VERTEX );
    rootNode.setRenderState( fogState );
View Full Code Here

   *
   */
  protected void buildLighting() {
    // Set up a basic, default light.
    DirectionalLight light = new DirectionalLight();
    light.setDiffuse(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
    light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
    light.setDirection(new Vector3f(1, -1, 0).normalize());
    light.setEnabled(true);

    // Attach the light to a lightState and the lightState to root.
    LightState lightState = display.getRenderer().createLightState();
View Full Code Here

        for (int x = 0; x < size; x++) {
            for (int z = 0; z < size; z++) {
                orand = rand.nextFloat() - .5f;
                for (int i = 0; i < turnNumber; i++) {
                    frand = (rand.nextFloat() * 0.50f) + 0.50f;
                    GeometryBatchInstance instance = new GeometryBatchInstance(q, new GeometryBatchInstanceAttributes(instanceTranslation.set((x * VegetationManager.VEGETATION_STEP) + orand, scale / 2, (z * VegetationManager.VEGETATION_STEP) + orand), new Vector3f(scale * frand, scale * frand, scale * frand), new Quaternion().fromAngleAxis((float) ((Math.PI * 2) / turnNumber) * i, Vector3f.UNIT_Y), new ColorRGBA(INSTANCE_COLOR.r + (rand.nextFloat() / 10f), INSTANCE_COLOR.g + (rand.nextFloat() / 8f), INSTANCE_COLOR.b + (rand.nextFloat() / 8f), INSTANCE_COLOR.a)));

                    creator.addInstance(instance);
                }
            }
        }
View Full Code Here

        buf.setEnabled(true);
        buf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
        rootNode.setRenderState(buf);

        PointLight light = new PointLight();
        light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 1.0f, 0.75f));
        light.setAmbient(new ColorRGBA(0.1f, 0.1f, 0.1f, 1.0f));
        light.setLocation(new Vector3f(40, 40, 40));
        light.setEnabled(true);

        PointLight light2 = new PointLight();
        light2.setDiffuse(new ColorRGBA(1.0f, 0.0f, 0.0f, 0.0f));
        light2.setAmbient(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f));
        light2.setLocation(new Vector3f(-140, -140, -140));
        light2.setEnabled(true);
        light2.setShadowCaster(true);
        lightState = display.getRenderer().createLightState();
        lightState.setEnabled(true);
View Full Code Here

        axisRoot=new Node("axnode");
        axisRoot.setLocalTranslation(0, 0, 0);

        MaterialState materialp = display.getRenderer().createMaterialState();
        materialp.setShininess( 128 );
        ColorRGBA color = new ColorRGBA( 0.5f, 0.5f, 0.5f, 0.1f );
        materialp.setDiffuse( color );
        materialp.setAmbient( color.mult( new ColorRGBA( 0.5f, 0.5f, 0.5f, 0.1f ) ) );
        planeXY=new Box("planeXY",new Vector3f(0.05f,0,0.05f),0.1f,0.0001f,0.1f);
        planeXY.setRenderState(materialp);

        MaterialState materialx = display.getRenderer().createMaterialState();
        materialx.setShininess( 128 );
        color = new ColorRGBA( 1f, 0f, 0f, 0.1f );
        materialx.setDiffuse( color );
        materialx.setAmbient( color.mult( new ColorRGBA( 1f, 0.1f, 0.1f, 1 ) ) );



        axisXArrow=new Arrow("ax",0.1f,0.01f);
        axisXArrow.setLocalTranslation(new Vector3f(0.05f,0,0));
        axisXArrow.rotateUpTo(new Vector3f(1,0,0));
        axisXArrow.setRenderState(materialx);

        MaterialState materialy = display.getRenderer().createMaterialState();
        materialy.setShininess( 128 );
        color = new ColorRGBA( 0f, 1f, 0f, 0.5f );
        materialy.setDiffuse( color );
        materialy.setAmbient( color.mult( new ColorRGBA( 0.1f, 1f, 0.1f, 0.5f ) ) );

        axisYArrow=new Arrow("ay",0.1f,0.01f);
        axisYArrow.setLocalTranslation(new Vector3f(0,0.05f,0));
        axisYArrow.rotateUpTo(new Vector3f(0,1,0));
        axisYArrow.setRenderState(materialy);

        MaterialState materialz = display.getRenderer().createMaterialState();
        materialz.setShininess( 128 );
        color = new ColorRGBA( 0f, 0f, 1f, 0.5f );
        materialz.setDiffuse( color );
        materialz.setAmbient( color.mult( new ColorRGBA( 0.1f, 0.1f, 1f, 0.5f ) ) );

        axisZArrow=new Arrow("az",0.1f,0.01f);
        axisZArrow.setLocalTranslation(new Vector3f(0,0,0.05f));
        axisZArrow.rotateUpTo(new Vector3f(0,0,1));
        axisZArrow.setRenderState(materialz);
View Full Code Here

            sharedMesh.setLocalScale(r.nextInt(50) * 0.1f);
            MaterialState ms = renderer.createMaterialState();
            linesPoint.add(sharedMesh.getLocalTranslation());

            if (useTransparency) {
                ms.setDiffuse(new ColorRGBA(r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, (r.nextInt(40) + 60) * 0.01f));
            } else {
                ms.setDiffuse(new ColorRGBA(r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, 1));
            }
            sharedMesh.setRenderState(ms);
            sharedMesh.updateModelBound();
            //sharedMesh.lock();
            subNode[index].attachChild(sharedMesh);
View Full Code Here

TOP

Related Classes of com.jme.renderer.ColorRGBA

Copyright © 2018 www.massapicom. 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.