[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fw: [x3d-public] Size of live Box



George Anastassakis wrote:
AFAIK, there is no way to do this currently specified. See the February thread "Bounding box of live X3DNode" in the list archives.


I believe that thread was about getting a bounding box (or, better put, limits, depending on what model's internally used) for any given geometry node. Instead, I'm talking about the very size of primitive geometry nodes to calculate the bounding boxes myself (in fact, said thread was the reason I started writting my own bounding box calculation code). For such nodes, size is very well defined by a number of fields and cannot change in any way other than modifying the field values themselves (which could still not be allowed even if the fields where readable), neither would it's availability make browser implementors adopt any specific approach as to anything (in contrast to providing live bbCenter and bbSize values). So I don't see the point in hiding their values.


There is no way in X3D to say the difference between hiding a value and being able to change a value. Ie the only way to make that value accessible is to change it from initializeOnly to inputOutput.


As an inputOutput field you could then change its value. A possible browser optimization on the primitives is to share one instance per size internally. Ie all the boxes of size 2 2 2 would have one bit of geometry. Since you know the box can't change size you can do that sort of optimization. Every time something is made initializeOnly its because a browser implementor had a good case for how they could optimize speed or memory consumption based on the restriction. Over time we can reexamine these decisions. But each one was a premeditated action.

Another route you could use would be to drop the values into a metadata node. Ie if you have something generating the X3D, then when it writes out the node it could also write out a description for your code to read later.

Box {
   metadata MetadataString {
      name "Size"
      value ["3 2 3"]
   }
   size 3 2 3
}

--
Alan Hudson

President Yumetech, Inc.                               www.yumetech.com
President Web3D Consortium                             www.web3d.org
206 340 8900
-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html