AntoineSfx Posted November 23, 2023 Share Posted November 23, 2023 I'm trying to bounce a ray inside a curve, starting from a point with an initial vector v@v which tells the initial direction. I'm providing a curve and a starting point so that we can see if and when it starts to differ / exit the curve. curve.obj The algorithm is as follows Starting from (0,0,0) in direction (0,0,-1) Ray SOP against the curve. reflect @v using: v@v = reflect(v@v, v@N); repeat It quickly gets stuck on the curve for a reason that's not clear; The worst case scenario is when the direction is really close to the tangent of the polygon at the hit point; then it's possible that the next ray will start shooting through the curve if you use the bias option in Ray. I mean .. it kinda solves the problem in some cases, but it opens the door to other ones. Is there a robust solution to this ? It's not that critical, it's just for viz; but I'm curious because comp'l geometry is known to be really tricky. Probably going to end up with a collision pad Quote Link to comment Share on other sites More sharing options...
fencer Posted November 24, 2023 Share Posted November 24, 2023 Should be simple with sop. bouncing_ray_inside_a_curve_v01.hip 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.