7

How do you create a .dae file from a 3D model? I've created a 3D model from a drone areal mapping and now have a very large file I can import in to Photoshop, but I can't figure out how to create a .dae file I can use in SceneKit.

The default game example for Xcode has a SceneKit that shows a rotating aircraft, and the asset is a .dae file, but I don't see any documentation on how to create one of those from a 3D model, and how to correctly apply a texture to it.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
ricozinn
  • 131
  • 1
  • 8
  • Seems like there should be a tutorial out there somewhere that explains how to start with a 3d model .OBJ file, and using Photoshop or some other similar tool and Xcode, explain how to create the sample SceneKit starter project you see in Xcode 6.1 currently. Let me know if anyone has found something like that. – ricozinn Nov 20 '14 at 16:36
  • 1
    Most 3D modeling software can export to COLLADA files (.dae). Try one of those. As this question is currently phrased, it is not about ptogramming. – David Rönnqvist Nov 20 '14 at 16:39
  • 1
    similar question: http://blender.stackexchange.com/questions/14584/properly-export-collada-for-use-in-scenekit – mnuages Nov 20 '14 at 17:13
  • This [article](http://blog.manbolo.com/2014/08/10/import-cheetah3d-model-in-scenekit) might help you – Leonardo Nov 26 '14 at 17:03

1 Answers1

3

To create a 3D model and export it as a Collada .dae file you can use any of the following 3D authoring tools: Autodesk Maya, Blender, Autodesk 3dsMax, The Foundry Modo, Maxon Cinema 4D, SideFX Houdini, etc. The simplest way is to use a non-commercial student version of Autodesk Maya 2024. It's free. You can download it from HERE.

There are countless examples in YouTube how to model and uv-map in Maya software. Look at this example of UV-mapping in Maya. So, when your 3D model (and its UV-texture) is ready for use, you can export it as one of the five formats supported by SceneKit:

  • animated Collada DAE
  • animated Pixar USDZ
  • animated Autodesk FBX
  • single-frame Sony Alembic
  • single-frame Wavefront OBJ with MTL

enter image description here

For exporting DAE models, in Maya Export Type choose DAE_FBX export:

enter image description here

You can export a 2K UV-mapped texture as JPEG or PNG file.

enter image description here

You must assign this UV-mapped square texture to a Diffuse slot of properties in Lighting Model (shader) in Show the Material Inspector.

enter image description here

And here's how you can do it programmatically:

import SceneKit

let scene = SCNScene(named: "art.scnassets/mushroom.scn")!

let mushroom = scene.rootNode.childNode(withName: "mushroom", 
                                     recursively: true)!

let mushroomMaterial = SCNMaterial()
mushroomMaterial.diffuse.contents = UIImage(named: "mushroom.png")
mushroom.geometry.materials = [mushroomMaterial]

P. S.

Working with Pixar's USDZ file format:

If you need to generate .usdz file, use the following command in Terminal:

usdzconvert file.fbx

Here you can read about usdzconvert command.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220