-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bounding sphere of a modal mesh #33
Comments
The first thing to do is check that your
The code you provide is doing some really strange stuff with the center of the bounding box. You create a translation based on the bounding sphere center, and then transform the bounding box by that translation. The result is meaningless. All you really need to do is transform the
BTW, for debugging collision geometry, you should take a look at DebugDraw
|
It's in the link I gave you. DebugDraw.h and DebugDraw.cpp. |
I have the following code, but the sphere is translated and its not surrounding the tree. its translated behind it. here is how I'm rendering it
|
What's the original values in |
m_bounding {Center={x=0.00674819946 y=72.5237503 z=-0.932399750 } Radius=110.144882 } DirectX::BoundingSphere |
Ok. It looks valid at least. That said,
|
still the sphere is in wrong place |
Sure, but we are getting closer. Check the values of Also, what's the value of What format is your model loading from? |
Bounding box : box = {Center={x=0.00674819946 y=72.5237503 z=-0.932399750 } Extents={x=58.6604500 y=73.0773544 z=57.8838997 } } |
here is how I do the picking, which is incorrect due to the bounding sphere calculation is wrong, do you find a problem with it ?
|
That makes more sense :) The issue here is that the bounding sphere is not a particularly tight bound because of the way it is created. Try picking against the |
Hi,
I'm trying to get a bounding sphere of a modal mesh and transform it to world coordinates. but the bounding sphere without any transformation is not center at 0,0,0.
here is how I do the transformation```
The text was updated successfully, but these errors were encountered: