mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 20:32:12 +00:00
add distance threshold and scaling
This commit is contained in:
1 parent
6685e41e14
commit
cc1f822f5c
3 files changed
+16
-2
No files matched your search
@@ -202,7 +202,7 @@ pub fn run(capture_provider: Arc<CaptureProvider>, calibration_data: k4a_sys::k4
|
||||
|
||||
let change_delta = last_frame - last_change;
|
||||
|
||||
if change_delta > Duration::from_millis(5000) {
|
||||
/*if change_delta > Duration::from_millis(5000) {
|
||||
colorization_strategy = match colorization_strategy {
|
||||
ColorizationStrategy::Simple => ColorizationStrategy::Shaded, // NB: We won't do simple.
|
||||
ColorizationStrategy::Shaded => ColorizationStrategy::Color,
|
||||
@@ -213,7 +213,7 @@ pub fn run(capture_provider: Arc<CaptureProvider>, calibration_data: k4a_sys::k4
|
||||
|
||||
visualizer.set_colorization_strategy(colorization_strategy);
|
||||
last_change = Instant::now();
|
||||
}
|
||||
}*/
|
||||
|
||||
//rebinder.restore();
|
||||
|
||||
|
||||
@@ -101,6 +101,15 @@ void main()
|
||||
//
|
||||
vertexPosition.x *= -1;
|
||||
|
||||
// Distance Threshold
|
||||
// TODO: Make configurable.
|
||||
if (vertexPosition.z > 1.5) {
|
||||
alpha = 0.0f;
|
||||
vertexPosition.x = 0.0;
|
||||
vertexPosition.y = 0.0;
|
||||
vertexPosition.z = 0.0;
|
||||
}
|
||||
|
||||
imageStore(destTex, pixel, vec4(vertexPosition, alpha));
|
||||
}
|
||||
";
|
||||
|
||||
@@ -94,6 +94,11 @@ void main()
|
||||
ivec2 currentDepthPixelCoordinates = ivec2(gl_VertexID % pointCloudSize.x, gl_VertexID / pointCloudSize.x);
|
||||
vec3 vertexPosition = imageLoad(pointCloudTexture, currentDepthPixelCoordinates).xyz;
|
||||
|
||||
// Scale up while model view matrices not implemented.
|
||||
vertexPosition.x *= 5.0;
|
||||
vertexPosition.y *= 5.0;
|
||||
vertexPosition.z *= 5.0;
|
||||
|
||||
gl_Position = projection * view * vec4(vertexPosition, 1);
|
||||
|
||||
vertexColor = inColor;
|
||||
|
||||
Reference in new issue
Block a user