Exemplo n.º 1
0
 // a helper to show the world-axis-aligned bounding box for an object
 public static BoundingBoxHelper Create(Renderer renderer, Object3D o, Color? color = null)
 {
     var c = color.HasValue ? color.Value : new Color(0x888888);
     var geo = new BoxGeometry(1, 1, 1);
     var mat = new MeshBasicMaterial(renderer)
     {
         Diffuse = c,
         UseWireframe = true
     };
     var boundingBoxHelper = new BoundingBoxHelper(geo, mat);
     boundingBoxHelper.o = o;
     boundingBoxHelper.box = Box3.Empty;
     return boundingBoxHelper;
 }
Exemplo n.º 2
0
        // a helper to show the world-axis-aligned bounding box for an object
        public static BoundingBoxHelper Create(Renderer renderer, Object3D o, Color?color = null)
        {
            var c   = color.HasValue ? color.Value : new Color(0x888888);
            var geo = new BoxGeometry(1, 1, 1);
            var mat = new MeshBasicMaterial(renderer)
            {
                Diffuse      = c,
                UseWireframe = true
            };
            var boundingBoxHelper = new BoundingBoxHelper(geo, mat);

            boundingBoxHelper.o   = o;
            boundingBoxHelper.box = Box3.Empty;
            return(boundingBoxHelper);
        }