UpdateBounds for small line/point geometrys wrong.
Hi, I use small line geometrys and the calculated bounds are to huge. The Length Squared() was < 0.01 .. I found this code in Line Geometry 3D.cs..
public override void UpdateBounds() { base.UpdateBounds(); //if (Bound.Size.LengthSquared() < 1e-1f) //{ // var off = new Vector3(0.5f); // Bound = new BoundingBox(Bound.Minimum - off, Bound.Maximum + off); //} if (BoundingSphere.Radius < 1e-1f) { BoundingSphere = new BoundingSphere(BoundingSphere.Center, 0.5f); } }
When i remove the check everything is working for me.
The bounds, zoom-extends, ... is working.
What is the reseon for this size check??
To reproduce this, take workitem example 51 ..
And use only one LineGeometry3D with this resources.xaml..
<dx:LineGeometry3D x:Key="Lines" Indices="0 1 1 2 2 3 3 0 4 5 5 6 6 7 7 4 0 4 1 5 2 6 3 7" Positions="-0.05,-0.025,-0.1 0.05,-0.025,-0.1 0.05,0.025,-0.1 -0.05,0.025,-0.1 -0.05,-0.025,0.1 0.05,-0.025,0.1 0.05,0.025,0.1 -0.05,0.025,0.1" />
Then use zoom extend.. And auto zoom is not working...
Probably I added it to avoid some floating point errors on hit testing on small bounding box. I can relax the minimum bound size.
Can you make the epsilon value public? So i can change this value for my use case.
I think you can try to do a scaling transform on top of your scene tree.
I cannot scale the top of this scene in my case.