Search in sources :

Example 16 with RenderProps

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

the class SegmentedPlanarConnector method defaultRenderProps.

protected static RenderProps defaultRenderProps(HasProperties host) {
    RenderProps props = RenderProps.createPointFaceProps(null);
    props.setFaceStyle(Renderer.FaceStyle.FRONT_AND_BACK);
    return props;
}
Also used : RenderProps(maspack.render.RenderProps)

Example 17 with RenderProps

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

the class SegmentedPlanarConnector method render.

public void render(Renderer renderer, int flags) {
    Vector3d nrm = new Vector3d(0, 0, 1);
    RigidTransform3d TDW = getCurrentTDW();
    RenderProps props = myRenderProps;
    Shading savedShading = renderer.setPropsShading(props);
    renderer.setFaceColoring(props, isSelected());
    renderer.setFaceStyle(props.getFaceStyle());
    ArrayList<Plane> planes = mySegPlaneCoupling.getPlanes();
    for (int i = 0; i < planes.size(); i++) {
        Plane plane = planes.get(i);
        nrm.set(plane.getNormal());
        computeRenderVtxs(i, TDW);
        renderer.beginDraw(DrawMode.TRIANGLE_STRIP);
        if (myRenderNormalReversedP) {
            renderer.setNormal(-nrm.x, -nrm.y, -nrm.z);
        } else {
            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);
    renderer.setFaceStyle(FaceStyle.FRONT);
    renderer.drawPoint(myRenderProps, myRenderCoords, isSelected());
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) Vector3d(maspack.matrix.Vector3d) Plane(maspack.matrix.Plane) RenderProps(maspack.render.RenderProps) Shading(maspack.render.Renderer.Shading)

Example 18 with RenderProps

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

the class SlottedRevoluteJoint method defaultRenderProps.

protected static RenderProps defaultRenderProps(HasProperties host) {
    RenderProps props = RenderProps.createPointLineProps(host);
    props.setLineColor(Color.BLUE);
    props.setLineStyle(LineStyle.CYLINDER);
    return props;
}
Also used : RenderProps(maspack.render.RenderProps)

Example 19 with RenderProps

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

the class ParticlePlaneConstraint method defaultRenderProps.

protected static RenderProps defaultRenderProps(HasProperties host) {
    RenderProps props = RenderProps.createFaceProps(null);
    props.setFaceStyle(Renderer.FaceStyle.FRONT_AND_BACK);
    return props;
}
Also used : RenderProps(maspack.render.RenderProps)

Example 20 with RenderProps

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

the class ParticlePlaneConstraint method render.

public void render(Renderer renderer, int flags) {
    if (myPlaneSize > 0) {
        computeRenderVtxs();
        RenderProps props = myRenderProps;
        Shading savedShading = renderer.setPropsShading(props);
        renderer.setFaceColoring(props, isSelected());
        renderer.setFaceStyle(props.getFaceStyle());
        renderer.beginDraw(DrawMode.TRIANGLE_STRIP);
        renderer.setNormal(myNrm.x, myNrm.y, myNrm.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);
    }
}
Also used : RenderProps(maspack.render.RenderProps) Shading(maspack.render.Renderer.Shading)

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