Tabnine Logo
Material.setDiffuseColor
Code IndexAdd Tabnine to your IDE (free)

How to use
setDiffuseColor
method
in
javax.media.j3d.Material

Best Java code snippets using javax.media.j3d.Material.setDiffuseColor (Showing top 8 results out of 315)

origin: com.github.fracpete/princeton-java-stdlib

  private void setColor (Appearance ap, Color c) {
    Material m = ap.getMaterial();
    m.setAmbientColor(new Color3f(c));
    m.setDiffuseColor(new Color3f(c));
    float alpha = ((float)c.getAlpha()) / 255;
    if (alpha < 1.0) {
      TransparencyAttributes t = new TransparencyAttributes();
      t.setTransparencyMode(TransparencyAttributes.BLENDED);
      t.setTransparency(1 - alpha);
      ap.setTransparencyAttributes(t);
    } else ap.setTransparencyAttributes(null);
  }
}
origin: com.googlecode.princeton-java-introduction/stdlib

  private void setColor (Appearance ap, Color c) {
    Material m = ap.getMaterial();
    m.setAmbientColor(new Color3f(c));
    m.setDiffuseColor(new Color3f(c));
    float alpha = ((float)c.getAlpha()) / 255;
    if (alpha < 1.0) {
      TransparencyAttributes t = new TransparencyAttributes();
      t.setTransparencyMode(TransparencyAttributes.BLENDED);
      t.setTransparency(1 - alpha);
      ap.setTransparencyAttributes(t);
    } else ap.setTransparencyAttributes(null);
  }
}
origin: eu.mihosoft.vrl/vrl

float b = color.getBlue() / 255.f;
mat.setDiffuseColor(r, g, b);
origin: eu.mihosoft.vrl/vrl

float b = color.getBlue() / 255.f;
mat.setDiffuseColor(r, g, b);
origin: eu.mihosoft.vrl/vrl

float b = color.getBlue() / 255.f;
mat.setDiffuseColor(r, g, b);
origin: eu.mihosoft.vrl/vrl

mat.setDiffuseColor(r, g, b); 
origin: eu.mihosoft.vrl/vrl

mat.setDiffuseColor(r, g, b);
origin: eu.mihosoft.vrl/vrl

/**
 * Returns a solid appearance.
 * @return the appearance
 */
private Appearance getColoredAppearance() {
  Appearance a = new Appearance();
  PolygonAttributes pa = new PolygonAttributes();
  pa.setCullFace(PolygonAttributes.CULL_NONE);  // see both sides of shape
  pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
  pa.setBackFaceNormalFlip(true);
  a.setPolygonAttributes(pa);
  LineAttributes la = new LineAttributes();
  la.setLineAntialiasingEnable(true);
  la.setLineWidth(1.f);
  a.setLineAttributes(la);
  Material mat = new Material();
  mat.setSpecularColor(1.f, 1.f, 0.8f);
  mat.setDiffuseColor(1.f, 0.4f, 0.1f);
  mat.setShininess(20.f);
  mat.setLightingEnable(true);
  a.setMaterial(mat);
  return a;
}
javax.media.j3dMaterialsetDiffuseColor

Popular methods of Material

  • <init>
  • setLightingEnable
  • setCapability
  • getShininess
  • setAmbientColor
  • setShininess
  • getAmbientColor
  • getDiffuseColor
  • getEmissiveColor
  • getLightingEnable
  • getSpecularColor
  • setColorTarget
  • getSpecularColor,
  • setColorTarget,
  • setSpecularColor

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now