modelio

SceneKit: how to recreate lighting from Google Poly for same OBJ file?

元气小坏坏 提交于 2019-12-18 06:56:17
问题 The goal is to recreate the lighting for this OBJ file: https://poly.google.com/view/cKryD9VnDEZ Code to load OBJ file into SceneKit (can download file from above link): let modelPath = "model.obj" let url = NSURL(string: modelPath) let scene = SCNScene(named: modelPath)! sceneView.autoenablesDefaultLighting = true sceneView.allowsCameraControl = true sceneView.scene = scene sceneView.backgroundColor = UIColor.white Options tried so far: 1) The default ambient lighting is much harsher than

How To Apply .MTL File on .OBJ 3d Model via SceneKit & Model I/O

拥有回忆 提交于 2019-11-30 13:55:56
问题 I am trying to apply an .mtl file texture on .obj 3d model via SceneKit & Model I/0. My code below works fine when I try to apply .jpg of a texture on it: let url = NSBundle.mainBundle().URLForResource("chair", withExtension: "obj") let asset = MDLAsset(URL: NSURL(string:url)!) guard let object = asset.objectAtIndex(0) as? MDLMesh else { //fatalError("Failed to get mesh from asset.") return } if shouldApplyTexture == true { var textureFileName = "chair.mtl" // Create a material from the

How To Apply .MTL File on .OBJ 3d Model via SceneKit & Model I/O

余生颓废 提交于 2019-11-30 08:30:27
I am trying to apply an .mtl file texture on .obj 3d model via SceneKit & Model I/0. My code below works fine when I try to apply .jpg of a texture on it: let url = NSBundle.mainBundle().URLForResource("chair", withExtension: "obj") let asset = MDLAsset(URL: NSURL(string:url)!) guard let object = asset.objectAtIndex(0) as? MDLMesh else { //fatalError("Failed to get mesh from asset.") return } if shouldApplyTexture == true { var textureFileName = "chair.mtl" // Create a material from the various textures let scatteringFunction = MDLScatteringFunction() let material = MDLMaterial(name:

SceneKit: how to recreate lighting from Google Poly for same OBJ file?

早过忘川 提交于 2019-11-29 11:28:59
The goal is to recreate the lighting for this OBJ file: https://poly.google.com/view/cKryD9VnDEZ Code to load OBJ file into SceneKit (can download file from above link): let modelPath = "model.obj" let url = NSURL(string: modelPath) let scene = SCNScene(named: modelPath)! sceneView.autoenablesDefaultLighting = true sceneView.allowsCameraControl = true sceneView.scene = scene sceneView.backgroundColor = UIColor.white Options tried so far: 1) The default ambient lighting is much harsher than the Google Poly lighting. Removing the ambient lighting rendered everything too flat. 2) Using four