Search in sources :

Example 1 with MeshRenderProps

use of maspack.render.MeshRenderProps in project artisynth_core by artisynth.

the class GLSparkleDebug method addContent.

protected void addContent(MultiViewer mv) {
    Color[] colors = { Color.RED, Color.GREEN, Color.BLUE, Color.CYAN, Color.GRAY, Color.MAGENTA, Color.ORANGE, Color.PINK, Color.YELLOW, Color.RED.darker().darker(), Color.GREEN.darker().darker(), Color.BLUE.darker().darker(), Color.CYAN.darker().darker(), Color.GRAY.darker().darker(), Color.MAGENTA.darker().darker(), Color.ORANGE.darker().darker(), Color.PINK.darker().darker(), Color.YELLOW.darker().darker(), Color.RED.brighter().brighter(), Color.GREEN.brighter().brighter(), Color.BLUE.brighter().brighter(), Color.CYAN.brighter().brighter(), Color.GRAY.brighter().brighter(), Color.MAGENTA.brighter().brighter(), Color.ORANGE.brighter().brighter(), Color.PINK.brighter().brighter(), Color.YELLOW.brighter().brighter() };
    PolygonalMesh mesh = MeshFactory.createIcosahedralSphere(1, 0);
    mesh.setFeatureColoringEnabled();
    for (int i = 0; i < mesh.numColors(); ++i) {
        mesh.setColor(i, colors[i % colors.length]);
    }
    mesh.setRenderProps(new MeshRenderProps());
    mesh.getRenderProps().setShading(Shading.FLAT);
    mv.addRenderable(mesh);
}
Also used : MeshRenderProps(maspack.render.MeshRenderProps) Color(java.awt.Color) PolygonalMesh(maspack.geometry.PolygonalMesh)

Aggregations

Color (java.awt.Color)1 PolygonalMesh (maspack.geometry.PolygonalMesh)1 MeshRenderProps (maspack.render.MeshRenderProps)1