how to convert .dae to .scn files in SceneKit
Exporting the .dae
is unnecessary; you can place the object directly into a .scn
file:
Create the new .scn
file in the .scnassets
folder, then drag the .dae
file into the scene.
.DAE or .SCN files are not displaying correctly in Xcode
After converting a .dae
model into .scn
Xcode's native format, you need to apply all available textures to your 3D model via Properties slots in Material Inspector.
The best format for textures in Xcode could be .png
(not a .tga
), because .png
files have relatively small size and can hold four channels – RGBA (.jpg
holds only RGB).
You can't combine Albedo
, AO
, and Normals
because these files are for different slots of Material Inspector: Albedo
for diffuse color, AO
for Ambient Occlusion soft shadows, Normals
for bump effect.
Or, you can assign these textures programmatically using Swift 4.1:
let material = SCNMaterial()
material.diffuse.contents = UIImage(named: "Albedo.png")
material.ambientOcclusion.contents = UIImage(named: "AO.png")
material.normal.contents = UIImage(named: "Normals.png")
P.S. If you can't see any parts of your 3D model in Xcode's Scene Graph, there's a normals issue
. You need to reverse polygon's normals in 3D authoring software.
Batch Converting Apple SCN files into DAE
You can try the xcrun
command to run scntool
and provide it input/output files, then the format.
xcrun scntool --convert fileIn.scn --output fileOut.dae --format dae
Related Topics
Sizing a Container View with a Controller of Dynamic Size Inside a Scrollview
Copy Text to Clipboard with iOS
How to Delete an App from Itunesconnect/App Store Connect
Shake Animation for Uitextfield/Uiview in Swift
Detected a Case Where Constraints Ambiguously Suggest a Height of Zero
Is There a Public API for Card View UI That Can Be Seen Across iOS 10
Uicollectionview Horizontal Paging - How to Use Flow Layout
Swift: Declare an Empty Dictionary
Uiimageview Aspect Fit and Center
Macos on Vmware Doesn't Recognize iOS Device
Change Uitextfield and Uitextview Cursor/Caret Color
How to Pop Two Views at Once from a Navigation Controller
How to Set Image as a Title to Uinavigationbar
Uicollectionview with a Sticky Header
How to Make Uibutton's Text Alignment Center? Using Ib
Drawrect Circle and Animate Size/Color
(Null) Libc++Abi.Dylib: Terminate Called Throwing an Exception