Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script src="js/aframe-teleport-controls.min.js"></script>

<script src="js/ambisonic_audio_component.js"></script>

<script src="js/ocean-plane.js"></script>
</head>
<body>

Expand Down Expand Up @@ -83,13 +83,13 @@

<a-assets>
<img id="sky_sphere-texture" src="textures/sky_sphere.jpg">

<a-asset-item id="office" src="models/office.gltf" />
<a-asset-item id="water" src="models/water.gltf" />
<a-asset-item id="steps" src="models/steps.gltf" />
<a-asset-item id="deck" src="models/deck.gltf" />
<a-asset-item id="table" src="models/table.gltf" />
<a-asset-item id="chairs" src="models/chairs.gltf" />
<img id="water-normal" src="models/JPEG/water_normal.jpg" />
<a-asset-item id="office" src="models/office.glb" />
<a-asset-item id="water" src="models/water.glb" />
<a-asset-item id="steps" src="models/steps.glb" />
<a-asset-item id="deck" src="models/deck.glb" />
<a-asset-item id="table" src="models/table.glb" />
<a-asset-item id="chairs" src="models/chairs.glb" />


</a-assets>
Expand All @@ -98,14 +98,14 @@

<!-- Using the asset management system. -->
<a-gltf-model src="#office"></a-gltf-model>
<a-gltf-model src="#water"></a-gltf-model>
<!-- <a-gltf-model src="#water"></a-gltf-model> -->
<a-gltf-model src="#steps"></a-gltf-model>
<a-gltf-model src="#deck"></a-gltf-model>
<a-gltf-model src="#table"></a-gltf-model>
<a-gltf-model src="#chairs"></a-gltf-model>



<a-ocean-plane material="normalMap: #water-normal; sphericalEnvMap: #cgsky;" position="0 -1 0"></a-ocean-plane>
<a-entity teleport-controls="button: trigger; collision-entities: #office #hall_low_floor" hand-controls="left"></a-entity>
<a-entity teleport-controls="button: trigger; collision-entities: #office #hall_low_floor" hand-controls="right"></a-entity>

Expand Down
35 changes: 35 additions & 0 deletions js/ocean-plane.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* global AFRAME, THREE */

AFRAME.registerComponent('wobble-normal', {
schema: {},
tick: function (t) {
if (!this.el.components.material.material.normalMap) return;
this.el.components.material.material.normalMap.offset.x += 0.0001 * Math.sin(t/10000);
this.el.components.material.material.normalMap.offset.y += 0.0001 * Math.cos(t/8000);
this.el.components.material.material.normalScale.x = 0.5 + 0.5 * Math.cos(t/1000);
this.el.components.material.material.normalScale.x = 0.5 + 0.5 * Math.sin(t/1200);
}
})

AFRAME.registerPrimitive('a-ocean-plane', {
defaultComponents: {
geometry: {
primitive: 'plane',
height: 10000,
width: 10000
},
rotation: '-90 0 0',
material: {
shader: 'standard',
color: '#8ab39f',
metalness: 1,
roughness: 0.2,
normalMap: 'url(https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/waternormals.jpg)',
normalTextureRepeat: '50 50',
normalTextureOffset: '0 0',
normalScale: '0.5 0.5',
opacity: 0.8
},
'wobble-normal': {}
},
});
Binary file added models/chairs.glb
Binary file not shown.
Binary file added models/deck.glb
Binary file not shown.
Binary file added models/office.glb
Binary file not shown.
Binary file added models/steps.glb
Binary file not shown.
Binary file added models/table.glb
Binary file not shown.
Binary file added models/water.glb
Binary file not shown.