Doodidoo
Doodidoo

Reputation: 31

RealityKit and ARKit – Specify Material Texture Application on Model

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]

Upvotes: 3

Views: 772

Answers (1)

Andy Jazz
Andy Jazz

Reputation: 58043

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.

Upvotes: 3

Related Questions