We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello! im using the hemesh library to construct 3D meshes, but ive a problem when i want to change the values of a constructor.. how can i change them? here in the example, i want to change the radius according mouseX position, but it doesnt do anything. i see hemeshve modifiers but i dont find any to change the radius or this parameters, like steps, or points.
import wblut.nurbs.*;
import wblut.hemesh.*;
import wblut.core.*;
import wblut.geom.*;
import wblut.processing.*;
import wblut.math.*;
WB_Render render;
WB_BSpline C;
WB_Point[] points;
HE_Mesh mesh;
HEC_SweepTube creator;
void setup() {
size(1000,1000,P3D);
smooth(8);
// Several WB_Curve classes are in development. HEC_SweepTube provides
// a way of generating meshes from them.
//Generate a BSpline
points=new WB_Point[11];
for (int i=0;i<11;i++) {
points[i]=new WB_Point(5*(i-5)*(i-5), -200+40*i, random(100));
}
C=new WB_BSpline(points, 4);
creator=new HEC_SweepTube();
creator.setCurve(C);//curve should be a WB_BSpline
creator.setSteps(40);
creator.setFacets(8);
creator.setCap(true, true); // Cap start, cap end?
mesh=new HE_Mesh(creator);
//HET_Diagnosis.validate(mesh);
render=new WB_Render(this);
}
void draw() {
creator.setRadius(mouseX);
background(55);
directionalLight(255, 255, 255, 1, 1, -1);
directionalLight(127, 127, 127, -1, -1, 1);
translate(width/2,height/2);
rotateY(mouseX*1.0f/width*TWO_PI);
rotateX(mouseY*1.0f/height*TWO_PI);
stroke(0);
render.drawEdges(mesh);
noStroke();
render.drawFaces(mesh);
}
Answers
There is a new forum- see processing main page