Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
noamnav
noamnav's Profile
2
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
3D bodies intersections
[1 Reply]
03-Apr-2012 03:48 AM
Forum:
General Discussion
hello all,
im looking for a way to check intersections between 3d bodies of different types.
I have so far tried using the Hemesh library, but without any success.
any Ideas as for how can i do so?
(or any references?)
thanks
Hemesh Library WB_transform
[2 Replies]
28-Mar-2012 02:56 AM
Forum:
Contributed Library Questions
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);
}
«Prev
Next »
Moderate user : noamnav
Forum