Jump to content
  • Advertisement

rajesh_nest

Member
  • Content Count

    148
  • Joined

  • Last visited

Community Reputation

136 Neutral

About rajesh_nest

  • Rank
    Member
  1. Need a help in understanding the logic behind the Ray-Box intersection. Ray Box Intersection does the following nt intersectBox_cpu(Ray_cpu r, float3 boxmin, float3 boxmax, float *tnear, float *tfar) { // compute intersection of ray with all six bbox planes float3 invR = {1.0/r.d.x,1.0/r.d.y,1.0/r.d.z}; float3 tbot = {invR.x*(boxmin.x - r.o.x), invR.y*(boxmin.y - r.o.y), invR.z*(boxmin.z - r.o.z)}; float3 ttop = {invR.x*(boxmax.x - r.o.x), invR.y*(boxmax.y - r.o.y), invR.z*(boxmax.z - r.o.z)}; // re-order intersections to find smallest and largest on each axis float3 tmin = fminf(ttop, tbot); float3 tmax = fmaxf(ttop, tbot); // find the largest tmin and the smallest tmax float largest_tmin = fmaxf(fmaxf(tmin.x, tmin.y), fmaxf(tmin.x, tmin.z)); float smallest_tmax = fminf(fminf(tmax.x, tmax.y), fminf(tmax.x, tmax.z)); *tnear = largest_tmin; *tfar = smallest_tmax; return smallest_tmax > largest_tmin; } I understood the first part. It finds the intersection Ray and six planes.  But the second part, finding  the largest tmin and the smallest tmax, is not very intuitive.   Can anyone help.
  2. I need to highlight the mouse selected point  on the mesh.    Now my application converts the 2D point into 3D  and redraws the  mesh. But the problem is, many times 3D point too small enough to get displayed. Then I draw another point  - x offset from the 3D  point. Though point is now visible, upon zooming the two points are visible.    I have seen some software, displaying selected point as small circles or other gemotries.    Any idea, how can we do this?
  3. I am trying to develop an application similar to volume rendering. Here I am considering Rays as traversing in cone beam (similar to perspective geometry) fashion. Each ray makes an angle say phi with the ray going through the center of the volume. Now my problem is that, few of my rays are missing the volume. Because of which my the rendered volume is clipped at the sides. Any suggestion for overcoming this issue. ( I test the rays against a bounding box. Bounding box is defined to be width, height and depth of the volume)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!