javascripthtmlx3dom

x3dom - Classroom Cardboard - how to load .x3d files?


This Classroom Cardboard example is using the x3dom framework to display 3d scenes. The example uses .bin files for their 3d objects. I want to use this example to load .x3d files instead of .bin files, but so far it doesn't render properly. I have tried loading examples from here using the inline tag like this

<background DEF='bgnd' skyColor="0 0 0"></background>
<group id='root' render='true'>
    <group DEF='theScene'>
        <Inline url="AllenDutton.x3d" render="true"></Inline>
    </group>
</group>

This is how it looks. I need some help on how to properly load .x3d files.

Thanks


Solution

  • Your viewpoint is too close to the model. You can use the scroll wheel to zoom in/out. Unfortunately, when you get far enough out to begin to see the entire model, the far clipping plane cuts in and the model gets culled out of the display.

    In the statement

    <viewpoint id='vpp' ,.. position='4.17102 1.00905 -6.97228' ... zFar="300">
    

    Change zFar to a bigger number, 450 is probably large enough. Ideally you will also want to change the position to be further away along the line running through the position point and the model. Initially, it is easier to wheel-scroll.

    Additional background information: