> Date:         Wed, 11 Apr 2001 12:57:48 +0530
> From: Niraj Patkar <[EMAIL PROTECTED]>
>
> I am using j3d compression classes in my application. Everything
> works fine, except that CompressedGeometry objects scale and offset
> themselves to fit into [-1 --> 1] cube.
>
> I found a few posts in this list with the same problem. I also
> checked java3D utils src and confirmed that this is normal behaviour.
>
> Now, to restore my geometry properly, do I need to maintain original
> scale and offset myself?

Yes, this is a shortcoming of the API which will be fixed by
implementing RFE (Request For Enhancement) 4374633: CompressionStream
should provide a method for getting original bounds.

In J3D 1.3 the CompressionStream class will provide methods for
retrieving the bounding box of the compressed geometry in both
normalized quantization coordinates and the original model coordinates.
>From these bounds a Transform3D can be set up to restore the original
scale and offset to model coordinates.

> I found that, CompressedGeometryHeader class
> earlier had some fields which were storing exactly the same information.
> But now those are deprecated. Can anybody tell me the possible
> reason behind this?

None of the public fields of the CompressedGeometryHeader class have
been deprecated as far as I can see.  There are two public fields
lowerBound and upperBound for specifying tight bounds for the compressed
geometry in normalized quantization coordinates (-1.0 .. 1.0).  If the
CompressedGeometry was created by GeometryCompressor, then those fields
will be set automatically.  These fields were added to implement RFE
4264113 in J3D 1.2.

Currently you still have to maintain the original bounds (or scale and
offset) in order to restore them properly from the lowerBound and
upperBound fields indicating the bounds of the compressed object.

Note that the range of normalized quantized coordinates is open at the
endpoints of -1.0 and +1.0.  The actual range across the longest X, Y,
or Z dimension depends upon the number of bits used to quantize the
positions (16 bits is the default) and is 1 quantum from -1.0 and +1.0
(-1.0 + 1/(2 ** numBits) and +1.0 - 1/(2 ** numBits)).  These are the
values that GeometryCompressor puts into lowerBound and upperBound
across the longest dimension.

-- Mark Hood

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to