forked from perfume-dev/example-processing
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPBvh.pde
45 lines (40 loc) · 888 Bytes
/
PBvh.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class PBvh
{
public BvhParser parser;
public PBvh(String[] data)
{
parser = new BvhParser();
parser.init();
parser.parse( data );
}
public void update( int ms )
{
parser.moveMsTo( ms );//30-sec loop
parser.update();
}
public void draw()
{
fill(color(0, 255, 0));
noStroke();
for ( BvhBone b : parser.getBones())
{
pushMatrix();
translate(b.absPos.x, b.absPos.y, b.absPos.z);
ellipse(0, 0, 5, 5);
popMatrix();
//BvhBone p = b.getParent();
//if(p != null) {
// stroke(255);
// line(b.absPos.x, b.absPos.y, b.absPos.z, p.absPos.x, p.absPos.y, p.absPos.z);
// noStroke();
//}
if (!b.hasChildren())
{
pushMatrix();
translate( b.absEndPos.x, b.absEndPos.y, b.absEndPos.z);
sphere(20);
popMatrix();
}
}
}
}