2
votes

I am playing with an ARKit and so far I am successful, but I have a problem with 3D graphic (as I don't know anything about it).

Every object I download from sites like TurboSquid is without textures in Xcode and even in Blender (or shows without textures).

I just need to get an object (the best would be .dae) with applied textures on it.

Can you please explain to my like to a three years old child what am I missing?

Thank you.

EDIT:

This is the model which is moving with camera even when I setup his location:

Table from TurboSquid

let treeScene = SCNScene(named: "art.scnassets/table2/table2.scn")
let treeNode = treeScene?.rootNode.childNode(withName: "table2", recursively: true)
treeNode?.position = position

sceneView.scene.rootNode.addChildNode(treeNode!)
1

1 Answers

4
votes

I'm also starting to learn ARKit and this is how i did it.

Some of the 3d models comes with textures in png files, which can then be copied to art.scnassets. The select the dae model and got the node that you want to apply the texture. In the Material Inspector in right hand side apply texture correspondingly.

Or

You can create a SCNMaterial using the texture and apply it to the node programmatically.

let material = SCNMaterial()
material.diffuse.contents = UIImage(named: "texture.png")

//Create the the node and apply texture
objectNode?.geometry?.materials = [material]

Try this as a trial

https://www.turbosquid.com/3d-models/free-missile-3d-model/595524

Apply the texture in diffuse (in Material Inspector).