How do I create an empty world? #241
-
What code / markup is needed to define the most basic possible Janus world? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It depends what you're looking to do. At the most basic level, you can open a blank Janus room by navigating in any existing JanusWeb client instance to 'about:blank'. This will give you an empty room with a simple ground plane, and from there you can load the edit panel and start adding things to the scene and changing properties about the world. If you'd like to go a step further and build persistent worlds, you can get started by creating a new HTML file, and adding some markup to it. The first thing you should do is include the JanusXR JavaScript library in the <script src="https://web.janusxr.org/janusweb.js"></script> (note - you can also refer to specific janusweb release versions, eg, Next, you will need to add a <html>
<head>
<script src="https://web.janusxr.org/1.5.42/janusweb.js"></script>
</head>
<body>
<janus-viewer url="about:blank"></janus-viewer>
</body>
</html> Finally, you will need to write some markup to define your empty world. If you don't specify a By adding a <janus-viewer>
<room>
<!-- room content goes here - nothing here yet! -->
</room>
</janus-viewer> Once you have added this code to your HTML file, you should be able to open the file in a web browser and see an empty Janus world. You can then add objects, materials, images, sounds, videos, particle effects, and a wide variety of other elements to the world using markup or JavaScript to create a more interesting and interactive experience. |
Beta Was this translation helpful? Give feedback.
It depends what you're looking to do.
At the most basic level, you can open a blank Janus room by navigating in any existing JanusWeb client instance to 'about:blank'. This will give you an empty room with a simple ground plane, and from there you can load the edit panel and start adding things to the scene and changing properties about the world.
If you'd like to go a step further and build persistent worlds, you can get started by creating a new HTML file, and adding some markup to it. The first thing you should do is include the JanusXR JavaScript library in the
<head>
of your HTML document. You can do this by adding the following code to your HTML file: