Jump to content
  • Advertisement
Sign in to follow this  
Alrecenk

(Vector vs Cubic surface) collision

This topic is 4783 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wasn't sure exactly what to call this, but I knew if I just put vector plane collision I'd get a bunch of answers without my post even being read. I need to solve the following equation for all possible combinations of l, t , and p(there should be 3 or 6 I think). V*l = (1-t)^3*A + 3*(1-t)^2*t*B + 3*(1-t)*t^2*C + t^3*D + (1-p^3*A + 3*(1-p)^2*p*E + 3*(1-p)*p^2*F+p^3*G l,t and p (the lowercase letters) are scalars and V,A,B,C,D,E,F and G(capital letters) are vectors. I had a hard time coming up with this equation and now that I have it I'm not entirely sure what to do with it. I don't expect anyone to solve it for me I'd just like some idea of where to begin. This isn't homework, but it isn't technically game related at this point either. You can view my program here. It could be game related eventually though.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You can try solving this problem numerically, of course.

I guess that Newton's or Broyden's methods are your best friend in this situation.
You can find a reasonably implementation of those algorithms in "Numerical Recipes in C", which is available on-line in PDF form.

Finding all of the solutions might be tricky through.
Maybe if you write about your problem in more detail, you'll get a better answer.

Share this post


Link to post
Share on other sites
generally these types of things are done using newton's method there is no closed form solution for a general quadric/ray equation. there are also subdivision methods for bezier patches, but they're slow too.

Tim

Share this post


Link to post
Share on other sites
Basically, I'm testing various methods for drawing curved surfaces. This equation would be used for a raytracing style method where the surface is created from 2 bezier curves. I know it's not the fastest way to go, but it would allow me to sample specific points. So, I guess I don't need all the possible combinations I just need the combination with the lowest "l".

So far I haven't been able to come up with any method for drawing curves that I consider fast enough to use in another program. So I would be interested to here about other methods for that as well.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!