3

Noob here. When using the following code, it wraps the image texture around the entire model. Is it possible to apply the image texture to a portion of the model (as opposed to the entire model itself) in RealityKit/ARKit?

CODE:

var material = SimpleMaterial()

material.baseColor = try! .texture(TextureResource.load(named: "image.jpg"))

modelSample?.model?.materials = [material]
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Doodidoo
  • 31
  • 2

1 Answers1

3

If you want to apply a texture to a portion of a AR model, not to an entire model, you have to UV-map this texture to a model in a 3d authoring tool (like 3dsMax, Maya, or Blender). UV-mapping is neither possible in RealityKit 1.0 nor in RealityKit 2.0.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • 1
    Could you please look into this question and share your thought? https://stackoverflow.com/questions/70684317/how-to-take-a-picture-while-using-arkit – elk_cloner Jan 15 '22 at 14:13
  • Hi @elk_cloner, read this post, please – https://stackoverflow.com/questions/66828300/arkit-on-different-iphones/66828695#66828695 – Andy Jazz Jan 15 '22 at 17:14