Skip to content

How do I add objects to my scene? #242

Answered by jbaicoianu
jbaicoianu asked this question in FAQs
Discussion options

You must be logged in to vote

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 i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jbaicoianu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
FAQs
Labels
None yet
1 participant