Skip to content

Commit

Permalink
Adjust basic environment example to include full tutorial
Browse files Browse the repository at this point in the history
Since only the "custom environment" bit is marked as "optional" in the docs.
  • Loading branch information
diarmidmackenzie committed Nov 13, 2024
1 parent d7d050f commit c72cd53
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/guides/building-a-basic-scene.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ To use the asset management system for an image texture:
</a-scene>
```

[View the example at this stage](https://aframe.io/examples/docs/basic-scene/).

## Creating a Custom Environment (Optional)

Previously we had the environment component generate the environment. Though
Expand Down Expand Up @@ -639,4 +637,6 @@ relatively sharp and performant:

And that's the basic example!

[View the example](https://aframe.io/examples/docs/basic-scene-2/).
[View the example](https://aframe.io/examples/docs/basic-scene/) (basic environment)

[View the example](https://aframe.io/examples/docs/basic-scene-2/) (custom environment)
24 changes: 22 additions & 2 deletions examples/docs/basic-scene/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,31 @@
If viewing this example locally, use http://localhost rather than http://127.0.0.1
-->
<img id="boxTexture" src="https://i.imgur.com/mYmmbrp.jpg">
<audio src="https://cdn.aframe.io/basic-guide/audio/backgroundnoise.wav" autoplay
preload></audio>
</a-assets>

<a-sound src="https://cdn.aframe.io/basic-guide/audio/backgroundnoise.wav" autoplay="true"
position="-3 1 -4"></a-sound>

<a-box src="https://i.imgur.com/mYmmbrp.jpg" position="0 2 -5" rotation="0 45 45"
scale="2 2 2"></a-box>
<a-box
src="#boxTexture"
position="0 2 -5"
rotation="0 45 45"
scale="2 2 2"
animation__position="property: object3D.position.y; to: 2.2; dir: alternate; dur: 2000; loop: true"
animation__mouseenter="property: scale; to: 2.3 2.3 2.3; dur: 300; startEvents: mouseenter"
animation__mouseleave="property: scale; to: 2 2 2; dur: 300; startEvents: mouseleave"
animation__click="property: rotation; from: 0 45 45; to: 0 405 45; dur: 1000; startEvents: click"></a-box>

<a-entity text="value: Hello, A-Frame; color: #FAFAFA; width: 5; anchor: align"
position="-0.9 0.2 -3"
scale="1.5 1.5 1.5"></a-entity>

<a-camera>
<a-cursor color="#FAFAFA"></a-cursor>
</a-camera>

<!-- Out of the box environment! -->
<a-entity environment="preset: forest; dressingAmount: 500"></a-entity>
<!-- Try changing the preset to one of default, contact, egypt, checkerboard, forest, goaland, yavapai, goldmine,
Expand Down

0 comments on commit c72cd53

Please sign in to comment.