|
| 1 | +#X3D V4.0 utf8 |
| 2 | +PROFILE Interchange |
| 3 | + |
| 4 | +# --------------------------------------------------------------------- |
| 5 | +# Test file that deliberately relies on browser's ability to download |
| 6 | +# remote resources (images, sounds, inline file) over the network. |
| 7 | +# |
| 8 | +# The related resources are deliberately *not* specified using relative |
| 9 | +# paths and *not* embedded in this file -- if the browser does not download |
| 10 | +# them, the scene will not render correctly. |
| 11 | +# --------------------------------------------------------------------- |
| 12 | + |
| 13 | +Shape { |
| 14 | + appearance Appearance { |
| 15 | + material Material { |
| 16 | + diffuseColor 1 1 1 |
| 17 | + diffuseTexture ImageTexture { |
| 18 | + url "https://github.com/castle-engine/demo-models/blob/master/textures/test_texture.png?raw=true" |
| 19 | + } |
| 20 | + } |
| 21 | + } |
| 22 | + geometry Box { } |
| 23 | +} |
| 24 | + |
| 25 | +Transform { |
| 26 | + translation 0 -2 0 |
| 27 | + children [ |
| 28 | + DEF TouchToPlaySound TouchSensor { } |
| 29 | + Shape { |
| 30 | + appearance Appearance { |
| 31 | + material UnlitMaterial { |
| 32 | + } |
| 33 | + } |
| 34 | + geometry Text { |
| 35 | + string "Click me to play a sound" |
| 36 | + fontStyle FontStyle { |
| 37 | + size 0.5 |
| 38 | + justify "MIDDLE" |
| 39 | + } |
| 40 | + } |
| 41 | + } |
| 42 | + DEF SoundToPlay Sound { |
| 43 | + source DEF SoundToPlayClip AudioClip { |
| 44 | + url "https://github.com/castle-engine/demo-models/raw/master/sound/werewolf_howling.wav" |
| 45 | + } |
| 46 | + } |
| 47 | + ] |
| 48 | +} |
| 49 | +ROUTE TouchToPlaySound.touchTime TO SoundToPlayClip.startTime |
| 50 | + |
| 51 | +Transform { |
| 52 | + translation 0 -4 0 |
| 53 | + scale 0.1 0.1 0.1 |
| 54 | + children Inline { |
| 55 | + # This glTF also refers to more files (textures, bin file with vertex data) |
| 56 | + # |
| 57 | + # TODO: Fails now, in view3dscene, |
| 58 | + # with Access Violation (but works when opened locally). |
| 59 | + #url "https://github.com/castle-engine/demo-models/blob/master/castle/castle.gltf?raw=true" |
| 60 | + } |
| 61 | +} |
0 commit comments