0

I am trying to use the ipad AR capability to visualize some molecules from my simulations.

I created a obj file, and I converted to usdz. If I open the file in xcode everything looks fine. If I use quickview or I move it to the ipad and open it, the colors are missing. I get the same results using usdzconvert 6.1, 6.2, and the export function in xcode.

To convert using usdzconverter I use in usdzconvert 6.1

usdzconvert ./myscene.obj test8.usdz -diffuseColor 1,1,1 -iOS12 -h

or In usdzconverter 6.2

usdzconvert  ./myscene.obj test5.usdz

I just open the .usdz files from the files app on the ipad or with quick view -i.e. space bar- on the mac.

I think the issue might be that in my scene colors are assigned to vertexes and not to the texture.

Does anyone have an idea on how to proceed?

E

PS: I am a total noob when it gets to 3D scenes, so probably I am not being particularly clear. I am happy to answer any question you might have.

emiacetale
  • 13
  • 4
  • Please share the code you use for loading your model. – de. Apr 04 '20 at 23:08
  • Hi de. I don't use any code to load the models, I just click on them from the file app or use quick look. If on the mac I open them using an app, I can see the proper color. If I use a file that has textures instead of vertexes color, I can see the right colors in quick view. I tried to edit my question with these infos. – emiacetale Apr 05 '20 at 19:13

1 Answers1

0

I had a similar issue before where the rendered usdz model was completely dark when I loaded it into the scene. I fixed it by adding a light source. Try something like this:

let spotLight = SCNNode()
spotLight.light = SCNLight()
spotLight.light?.type = .directional

sceneView.scene.rootNode.addChildNode(spotLight)
M Reza
  • 18,350
  • 14
  • 66
  • 71