Hemesh Library WB_transform
in
Contributed Library Questions
•
1 year ago
hello
newbie to the library and in general... patience required here
im trying to rotate a box (for example) created by hemesh library.
the normal rotation command does change its appearance, but not the real coordinates so that if i check for an
intersection with another box after the rotation - the result stays the same.
I beleive the WB_Transform class should do that, but i don't understand how to use it -
could someone assist? current code attached
many thanks
import processing.opengl.*;
import peasy.*;
PeasyCam pcam;
import wblut.hemesh.modifiers.*;
import wblut.geom.frame.*;
import wblut.hemesh.composite.*;
import wblut.core.processing.*;
import wblut.hemesh.tools.*;
import wblut.hemesh.simplifiers.*;
import wblut.hemesh.subdividors.*;
import wblut.geom.nurbs.*;
import wblut.core.random.*;
import wblut.geom.triangulate.*;
import wblut.hemesh.creators.*;
import wblut.geom.tree.*;
import wblut.hemesh.core.*;
import wblut.geom.grid.*;
import wblut.core.structures.*;
import wblut.core.math.*;
import wblut.geom.core.*;
WB_Render render;
WB_AABB a = new WB_AABB(0,0,0,250,250,50);
WB_AABB b = new WB_AABB(250,250,0,500,500,50);
WB_Transform t = new WB_Transform();
void setup() {
size (600,600,OPENGL);
render = new WB_Render(this);
pcam = new PeasyCam (this, 100);
pcam.lookAt (100,0,300,1000,1); //(look x, look y, look z, zoom, time to target);
}
void draw() {
background (185);
directionalLight(255, 255, 255, 1, 1, -1);
directionalLight(127, 127, 127, -1, -1, 1);
drawAxis();
//t.addRotateX(30);
fill(0,0,0,50);
// a.apply(t);
fill (0);
render.draw(a);
//rotate(PI/2);
fill (10,190,30);
render.draw(b);
//rotate (-PI/2);
println(a.checkIntersection(b));
}
void drawAxis() {
stroke(#F52C2C); //x is red
line (0,0,0,1000,0,0);
stroke(#8CF52C); //y is green
line (0,0,0,0,1000,0);
stroke(#615DFF); //z is blue
line (0,0,0,0,0,1000);
}
1