Skip to content

How do I add a texture to an object? #245

Answered by jbaicoianu
jbaicoianu asked this question in FAQs
Discussion options

You must be logged in to vote

If you're using a custom imported 3d model, such as a glTF, glb, fbx, obj, or other such file, the best place to set your textures is in the 3d editing program that you used to create or modify the model.

Janus also supports overriding materials in markup and at runtime, for primitives and for more complex models, using the image_id attribute. For example:

<janus-viewer>
  <assets>
    <assetobject id="racecar" src="racecar.obj" />
    <assetimage id="sponsors" src="sponsors.png" />
    <assetimage id="tree" src="tree.png" />
  </assets>
  <room>
    <object id="racecar" image_id="sponsors" />
    <object id="cone" image_id="tree" />
  </room>
  <room>
  </room>
</janus-viewer>

Replies: 1 comment

Comment options

jbaicoianu
Apr 7, 2023
Maintainer Author

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