How do I add objects to my scene? #242
-
Once I've got a basic scene running, how do I add objects to it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To add objects to your scene, you can add them to your room's markup: <html>
<head>
<title>My Janus World</title>
<script src="https://web.janusxr.org/janusweb.js"></script>
</head>
<body>
<janus-viewer>
<room>
<object pos="0 0 0" scale="1 1 1" rotation="0 0 0" id="cube" js_id="mycube" col="#ff0000" />
</room>
</janus-viewer>
</body>
</html> This code creates an empty Janus world with a single object defined in the tag. The object is positioned at the origin (0, 0, 0), has a default scale of 1x1x1, and is rotated by 0 degrees around the x, y, and z axes. The object uses the default cube object included in JanusXR and has a red color applied to it. The js_id attribute is used to reference the object in JavaScript code. You can learn more about the different object properties and how to define them in the JanusXR documentation. |
Beta Was this translation helpful? Give feedback.
To add objects to your scene, you can add them to your room's markup:
This code creates an empty Janus world with a single object defined in the tag. The object is positioned at the origin (0, 0, 0), has a default scale of 1x1x1, and is rotated by 0 degrees around the x, y, and z axes. The object uses the default cube object included in JanusXR and has a red color applied to i…