Example usage for javax.media.j3d TextureAttributes MODULATE

List of usage examples for javax.media.j3d TextureAttributes MODULATE

Introduction

In this page you can find the example usage for javax.media.j3d TextureAttributes MODULATE.

Prototype

int MODULATE

To view the source code for javax.media.j3d TextureAttributes MODULATE.

Click Source Link

Document

Modulate the object color with the texture color.

Usage

From source file:AppearanceExplorer.java

TextureAttributesEditor(TextureAttributes init) {
    super(BoxLayout.Y_AXIS);
    textureAttr = init;/*from  w w  w.j  av  a2 s  . co  m*/
    mode = textureAttr.getTextureMode();
    pcMode = textureAttr.getPerspectiveCorrectionMode();
    textureAttr.getTextureBlendColor(blendColor);

    String[] modeNames = { "REPLACE", "MODULATE", "DECAL", "BLEND", };
    int[] modeValues = { TextureAttributes.REPLACE, TextureAttributes.MODULATE, TextureAttributes.DECAL,
            TextureAttributes.BLEND, };

    IntChooser modeChooser = new IntChooser("Mode:", modeNames, modeValues, mode);
    modeChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            mode = event.getValue();
            textureAttr.setTextureMode(mode);
        }
    });
    add(modeChooser);

    Color4fEditor blendColorEditor = new Color4fEditor("Blend Color", blendColor);
    blendColorEditor.addColor4fListener(new Color4fListener() {
        public void colorChanged(Color4fEvent event) {
            event.getValue(blendColor);
            textureAttr.setTextureBlendColor(blendColor);
        }
    });
    add(blendColorEditor);

    String[] pcModeNames = { "NICEST", "FASTEST", };
    int[] pcModeValues = { TextureAttributes.NICEST, TextureAttributes.FASTEST, };

    IntChooser pcModeChooser = new IntChooser("Perspective Correction:", pcModeNames, pcModeValues, pcMode);
    pcModeChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            pcMode = event.getValue();
            textureAttr.setPerspectiveCorrectionMode(pcMode);
        }
    });
    add(pcModeChooser);

}