Fast Ply / Point Cloud loading
A custom built class with a Rubik’s Cube manipulation.
Two boxes, connected together . The first loads a .ply file:
// load a Ply file
var LoadPly = Java . type ( " trace.graphics.FastLoadPly " )
var ply = new LoadPly ( " /Users/marc/Desktop/andre_playground/fused_small_ascii.ply " )
// make a layer for it
var layer = _ . stage . withName ( " pointLayer " )
layer . is3D = true
layer . vrDefaults ()
layer . makeKeyboardCamera ()
layer . bindPointShader ( _ )
// export it
_ . ply = ply
We’ve put this in a separate box, since it might be slow to execute, we only really want to do it once. The second (the ‘child’ of the first), can contain animations like this:
var ply = _ . ply
var layer = _ . stage . withName ( " pointLayer " )
// give us control over the shader
layer . bindLineShader ( _ )
while ( _ . stage . frame ())
{
// rotate around the center, direction up, by 0.01 radians
ply . planarRotate ( vec ( 0 , 0 , 0 ), vec ( 0 , 0 , 1 ), 0.01 )
ply . show ( layer , " theroom " )
}
This yields: