Scale and Bounding Sphere

Mar 26, 2011 at 3:56 AM

If I load a mesh, then scale that mesh using Node.Scale, it seems the bounding sphere is not scaled. I have a mesh that is very small, but I scale it up, by a factor of 25. Since the mesh is so small the bounding sphere has a radius of about 3, but when scaled up the bounding sphere should be much larger. Since the bounding sphere isn't scaled, the mesh disappears when the camera is positioned in such a way as only a far side of the mesh is visible. It's clipped. This makes sense, because the smaller bounding sphere isn't in the view. If the bounding sphere was scaled, the larger sphere would be in the view.

I actually scale by using the node.World matrix, but I noticed while looking at the code that the world matrix uses the Node.Scale property to modify itself. I assume the Node.World is actually what should control the scaleing of the bounding sphere.

Or am I scaling wrong?


Mar 29, 2011 at 10:41 PM

Well, both should be OK actually, they are all combined and should end up as the RenderingWorld which the bounding spheres should also be using. That being said, the bounding sphere itself is not modified, but the places its being used will use the renderingworld and apply that matrix to it (at least that was what the intention was). Its a bit of a flaw in the system, IMO. I'd much rather have the bounding sphere reflect the actual reality.