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;
}
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());
}
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;
}
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;
}
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);
}
}
Aggregations