[c++] AABox, falloff to an arbitrary point

Started by
1 comment, last by zfvesoljc 14 years ago
I have an axis aligned box, with a 3D point ("center") inside (or even outside perhaps) the box. What would I like to do is calculate falloff from this point to an arbitrary position inside the box. If the box was a sphere and the point would always the sphere center, this would be pretty straight forward, but since the "center" point can be moved... I'm not looking for all out precise calculations, an approximation would suffice (speed wise). Currently only linear and cubic falloff are needed. Any ideas of how to handle this?
Advertisement
Why is the box relevant? Why isn't this just calculating the falloff between the 'center' point and your arbitrary point?

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

You are right... I'm just gonna use a sphere, simpler and faster. I'm working on a deflector/attractor system for particles. Don't really know why I wanted to complicate with boxes and arbitrary center point...

This topic is closed to new replies.

Advertisement