Search in sources :

Example 76 with RenderProps

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

the class ParticleLineConstraint method render.

public void render(Renderer renderer, int flags) {
    if (myLineSize > 0) {
        computeRenderVtxs();
        RenderProps props = myRenderProps;
        Shading savedShading = renderer.setPropsShading(props);
        renderer.setLineColoring(props, isSelected());
        renderer.drawLine(myRenderVtxs[0], myRenderVtxs[1]);
        renderer.setShading(savedShading);
    }
}
Also used : RenderProps(maspack.render.RenderProps) Shading(maspack.render.Renderer.Shading)

Example 77 with RenderProps

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

the class PlanarConnector method render.

public void render(Renderer renderer, int flags) {
    Vector3d nrm = new Vector3d(0, 0, 1);
    RigidTransform3d TDW = getCurrentTDW();
    computeRenderVtxs(TDW);
    nrm.transform(TDW);
    RenderProps props = myRenderProps;
    Shading savedShading = renderer.setPropsShading(props);
    renderer.setFaceColoring(props, isSelected());
    renderer.setFaceStyle(props.getFaceStyle());
    renderer.beginDraw(DrawMode.TRIANGLE_STRIP);
    renderer.setNormal(nrm.x, nrm.y, nrm.z);
    renderer.addVertex(myRenderVtxs[3]);
    renderer.addVertex(myRenderVtxs[0]);
    renderer.addVertex(myRenderVtxs[2]);
    renderer.addVertex(myRenderVtxs[1]);
    renderer.endDraw();
    renderer.setShading(savedShading);
    // set default
    renderer.setFaceStyle(FaceStyle.FRONT);
    renderer.drawPoint(myRenderProps, myRenderCoords, isSelected());
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) Vector3d(maspack.matrix.Vector3d) RenderProps(maspack.render.RenderProps) Shading(maspack.render.Renderer.Shading)

Example 78 with RenderProps

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

the class SoftPlaneCollider method defaultRenderProps.

protected static RenderProps defaultRenderProps(HasProperties host) {
    RenderProps props = RenderProps.createMeshProps(host);
    props.setFaceColor(new Color(0.5f, 0.5f, 0.5f));
    props.setFaceStyle(Renderer.FaceStyle.FRONT_AND_BACK);
    props.setAlpha(0.8);
    props.setShininess(32);
    return props;
}
Also used : Color(java.awt.Color) RenderProps(maspack.render.RenderProps)

Example 79 with RenderProps

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

the class PointList method render.

public void render(Renderer renderer, int flags) {
    RenderProps props = myRenderProps;
    if (myRob != null) {
        int numReg = myRob.numPoints(REG_GRP);
        int numSel = myRob.numPoints(SEL_GRP);
        // draw selected first
        if (renderer.isSelecting()) {
            if (numSel > 0) {
                drawPointsSelecting(renderer, SEL_GRP, props);
            }
            if (numReg > 0) {
                drawPointsSelecting(renderer, REG_GRP, props);
            }
        } else {
            if (numSel > 0) {
                drawPoints(renderer, SEL_GRP, props, /*selected=*/
                true);
            }
            if (numReg > 0) {
                drawPoints(renderer, REG_GRP, props, /*selected=*/
                false);
            }
        }
    }
}
Also used : PointRenderProps(maspack.render.PointRenderProps) RenderProps(maspack.render.RenderProps)

Example 80 with RenderProps

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

the class MotionTargetTerm method initTargetRenderProps.

public void initTargetRenderProps() {
    targetRenderProps = new RenderProps();
    targetRenderProps.setDrawEdges(true);
    targetRenderProps.setFaceStyle(FaceStyle.NONE);
    targetRenderProps.setLineColor(Color.CYAN);
    targetRenderProps.setLineWidth(2);
    targetRenderProps.setPointColor(Color.CYAN);
    targetRenderProps.setPointStyle(PointStyle.SPHERE);
    // set target point radius explicitly
    targetRenderProps.setPointRadius(myController.targetsPointRadius);
    myController.targetPoints.setRenderProps(targetRenderProps);
    myController.targetFrames.setRenderProps(targetRenderProps);
}
Also used : RenderProps(maspack.render.RenderProps)

Aggregations

RenderProps (maspack.render.RenderProps)86 Color (java.awt.Color)17 Vector3d (maspack.matrix.Vector3d)17 RigidBody (artisynth.core.mechmodels.RigidBody)11 RigidTransform3d (maspack.matrix.RigidTransform3d)11 Shading (maspack.render.Renderer.Shading)10 PolygonalMesh (maspack.geometry.PolygonalMesh)8 Point3d (maspack.matrix.Point3d)8 RenderObject (maspack.render.RenderObject)7 FrameMarker (artisynth.core.mechmodels.FrameMarker)6 File (java.io.File)6 IOException (java.io.IOException)6 Vertex3d (maspack.geometry.Vertex3d)6 AffineTransform3d (maspack.matrix.AffineTransform3d)4 ColorMapProps (maspack.render.ColorMapProps)4 HasRenderProps (maspack.render.HasRenderProps)4 LineRenderProps (maspack.render.LineRenderProps)4 AxialSpring (artisynth.core.mechmodels.AxialSpring)3 Muscle (artisynth.core.mechmodels.Muscle)3 LinkedList (java.util.LinkedList)3