[X3D-Public] Problem with X3D

Bederov, Sergey bederov at cortona3d.com
Fri Mar 2 03:16:43 PST 2012


Hello Iñaki,

This model is not closed because it contains only one polygon. It can only be a planar face which is not enough to form a closed model. The simplest closed model is a tetrahedron which has four polygons.

Speaking about the rendering problem, I suppose you are confused with the shape of the model which is distorted as compared with what you have seen in the editor. (By the way, which editor did you use?) The problem is caused by the loss of floating point precision. In X3D, the Coordinate node contains MFFloat values, i.e. single-precision floating-point numbers. A single-precision number can hold only 6 meaningful digits. In your file, some values have 11 digits of precision; in an X3D viewer, only 6 digits are processed and the remaining 5 digits are lost. Therefore, several different points become coincident, and the shape is distorted.

The size of this model is about 8 metres, and it is positioned at 4 thousand kilometres from the origin. (Or, if you use millimetres, then the model is 8 mm and positioned at 4 km). Do you really need to position the model that far away? Usually it is recommended to have all coordinates near zero; roughly speaking, you should have both positive and negative values in X, Y and Z. This will resolve all precision problems.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<X3D xmlns="http://www.web3d.org/specifications/x3d-namespace"
profile="Immersive">
<Scene>
<Shape>
<IndexedFaceSet
coordIndex="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -1">
<Coordinate
point="
0.736 -3.127 0
1.208 1.931 0
-3.354 2.4465 0
-7.5085 3.0355 0
-7.345 4.5175 0
-7.259 5.2945 0
-7.18 6.0135 0
-7.119 6.005 0
-1.845 5.5415 0
2.4415 5.165 0
7.9215 4.685 0
8.1615 4.685 0
7.1215 0.14 0
6.215 -3.849 0
0.9345 -3.153 0
0.9345 -3.153 0
" />
</IndexedFaceSet>
</Shape>
</Scene>
</X3D>

If you need the shape to be positioned in another location, you can use a Transform node. But please note that Transform also stores its fields as single-precision values; so, if you place the shape at 4 thousand kilometres, the precision will be about 4 metres and handling a 8-metre shape will again be difficult.

                                                                      Sergey Bederov



From: x3d-public-bounces at web3d.org [mailto:x3d-public-bounces at web3d.org] On Behalf Of Inaki Prieto Furundarena
Sent: Friday, March 02, 2012 11:56 AM
To: x3d-public at web3d.org
Subject: [X3D-Public] Problem with X3D

Hi all,

I have a problem with X3D during the rendering.

I have created the following X3D file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<X3D xmlns="http://www.web3d.org/specifications/x3d-namespace"
profile="Immersive">
<Scene>
<Shape>
<IndexedFaceSet
coordIndex="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -1">
<Coordinate
point="
405392.736 4533748.873 1010.8875
405393.208 4533753.931 1010.8875
405388.646 4533754.4465 1010.8875
405384.4915<tel:405384.4915> 4533755.0355 1010.8875
405384.655 4533756.5175 1010.8875
405384.741 4533757.2945 1010.8875
405384.82 4533758.0135 1010.8875
405384.881 4533758.005 1010.8875
405390.155 4533757.5415 1010.8875
405394.4415<tel:405394.4415> 4533757.165 1010.8875
405399.9215<tel:405399.9215> 4533756.685 1010.8875
405400.1615<tel:405400.1615> 4533756.685 1010.8875
405399.1215<tel:405399.1215> 4533752.14 1010.8875
405398.215 4533748.151 1010.8875
405392.9345<tel:405392.9345> 4533748.847 1010.8875
405392.9345<tel:405392.9345> 4533748.847 1010.8875
" />
</IndexedFaceSet>
</Shape>
</Scene>
</X3D>

I opened the X3D file with Instant player and bs player, but the result is the same in both tools.
I attach two pictures to see the problem during the rendering.
Why is not the model properly closed?

Thanks in advance!




--
Iñaki Prieto Furundarena

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20120302/b7a47d99/attachment.html>


More information about the X3D-Public mailing list