From 46f7f58dd6cf3c008e3ef0496f0ee60b52db6941 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Fri, 26 Aug 2011 01:27:43 -0400 Subject: no more 3d headache! 3d viewing angle changes depending on the distance to the object in the center of the screen. --- src/alpha.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/alpha.h') diff --git a/src/alpha.h b/src/alpha.h index 263fa1e..ac75834 100644 --- a/src/alpha.h +++ b/src/alpha.h @@ -10,8 +10,10 @@ #define ALPHA_DEPTH 10 -__device__ int get_color_alpha(const float3 &origin, const float3& direction, bool &hit, float &distance) +__device__ int get_color_alpha(const float3 &origin, const float3& direction) { + float distance; + if (!intersect_node(origin, direction, g_start_node, -1.0f)) return 0; @@ -95,13 +97,7 @@ __device__ int get_color_alpha(const float3 &origin, const float3& direction, bo while (node != head); if (n < 1) - { - hit = false; return 0; - } - - hit = true; - distance = distances[0]; float scale = 1.0f; float fr = 0.0f; -- cgit