scenekit

Get SCNVector3 from CGPoint

自闭症网瘾萝莉.ら 提交于 2019-12-01 00:10:17
I am trying to get a SCNVector3 from a CGPoint. I am using a gesture recognizer to get the location of a touch (as a CGPoint). The problem is that the touch doesn't always hit something when I hit test because there isn't always an object being touched. (Touch an empty space to move your ship to that empty spot). Other Stack Overflow question that I have found uses the SCNHitTestResult to get the worldCoordinates but that doesn't work for me. Does anyone know how to find this? Given that I know the z coordinate of course. Ships that move always move with a z position of 1. I Need

SceneKit – Animation with DAE file format

我的未来我决定 提交于 2019-11-30 22:05:14
I'm trying to animate my model on a SceneKit scene: create a simple cube model and export it to cube.dae create a simple skeleton for cube and make a simple rotation animation using bones and export it to animation.dae using Apple sample Fox demo (WWDC 2015), I tried to put model on scene and it works animate box rotation – it is working but after applying animation, the cube changes its position to (0,0,0) Maybe someone has succeeded with skeletal animation and SceneKit using another 3d tool (Maya, Blender, 3D Max)? to convert .dae to .scn I select DAE file and then in Xcode "editor" -->

How to rotate object in a scene with pan gesture - SceneKit

让人想犯罪 __ 提交于 2019-11-30 21:20:42
I'm tying to create an app with Scene kit to solve Rubix Cube. I've my own dae file for the cube. this is my setup code in viewDidLoad let myscene = SCNScene(named: "Rubik1.scnassets/Rubiks_Cube.dae") scene.rootNode.addChildNode((myscene?.rootNode)!) // retrieve the SCNView let scnView = self.view as! SCNView // set the scene to the view scnView.scene = scene geometryNode = (scnView.scene?.rootNode.childNodeWithName("Cube",recursively: true))! let panRecognizer = UIPanGestureRecognizer(target: self, action: "panGesture:") scnView.addGestureRecognizer(panRecognizer) upon recognising a pan

Which format file for 3d model SceneKit/ARKit better to use

风格不统一 提交于 2019-11-30 21:13:34
I read several tutorials how to place 3d objects in SceneKit/ARKit applications and all of them uses .scn format files for the objects. But I found there is no any issues if I use original .dae format and do not convert it to .scn format. I don't really see any difference between .dae and .scn formats. Actually result seems to me the same but can you explain what the difference between them and what I should use in what cases? Thank you! DAE (Digital Asset Exchange, aka Collada) is a vendor-neutral format for 3D assets. It supports a wide range of features that exist in multiple 3D authoring

SceneKit, CIFilter. CICategoryBlur filters nothing visible

雨燕双飞 提交于 2019-11-30 21:02:08
I'm trying to blur a node or create a blur effect in SceneKit. let ship = scene.rootNode.childNodeWithName("ship", recursively: true)! var ciFilters = [CIFilter]() ciFilters.append(CIFilter(name: "CIGaussianBlur", withInputParameters: [kCIInputRadiusKey: 30])!) ship.filters = ciFilters Results in: Which, I thought ok maybe I'm using the CIFilter incorrectly. However CIHalftone works fine: ciFilters.append(CIFilter(name: "CICMYKHalftone", withInputParameters: ["inputWidth": 20])!) I've also tried with CIZoomBlur also doesn't work, however CIPixellate does. Am I missing something fundamental

How to split out multiple animations from Collada file in SceneKit

倖福魔咒の 提交于 2019-11-30 20:56:18
I am loading a third-party .dae Collada file as a scene into a SceneKit project. The .dae file has many different animations in it, set at different times/frames. I am trying to figure out how I can split these out and reference each individual animation by reference name. There are no intelligible reference names in the dae file - the animations are all set as one single animation. I am able to parse out the animations into a CAAnimation object, and verify that I have successfully done so with the following code: SCNScene *scene = [SCNScene sceneNamed:@"art.scnassets/man.dae"]; SCNNode *man =

How to create a Portal effect in ARKit just using the SceneKit editor?

旧城冷巷雨未停 提交于 2019-11-30 20:39:16
问题 I would like to create a prototype like this one: just using Xcode SceneKit Editor. I found an answer where the room is created programmatically with simple SCNPlane objects and playing around with the rendering order. However, I would like to put together something more elaborated like downloading the 3d model of a room and make it accessible only through the portal. I'm trying to achieve the same effect directly in the Xcode's SceneKit editor converting this part: //a. Create The Left Wall

What are the requirements for supporting Collada/DAE models in SceneKit?

一曲冷凌霜 提交于 2019-11-30 19:31:40
问题 I have received Collada (DAE) files from several different 3D authoring tools (Rhino, Blender, Cinema4D, etc) and have found that sometimes the models fail to load. Xcode does not provide any information when a model fails to load. It simply shows an alert that says "The file couldn't be opened." Are there any requirements -- specific DAE version, limited subset of features, etc -- that my 3D designer should be aware of when exporting a DAE file for me? I have, of course, searched Apple's

SCNPhysicsWorld Error

谁说我不能喝 提交于 2019-11-30 17:35:08
问题 I've been messing around with swift and trying to get a Physicsworld working. This is the error I get "Undefined symbols for architecture i386: "_OBJC_CLASS_$_SCNPhysicsWorld", referenced from: __TFC3sk218GameViewController11viewDidLoadfS0_FT_T_ in GameViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) " I assume it has to do with linking or importing a library that I'm not, but I have added everything

SceneKit, CIFilter. CICategoryBlur filters nothing visible

。_饼干妹妹 提交于 2019-11-30 17:11:35
问题 I'm trying to blur a node or create a blur effect in SceneKit. let ship = scene.rootNode.childNodeWithName("ship", recursively: true)! var ciFilters = [CIFilter]() ciFilters.append(CIFilter(name: "CIGaussianBlur", withInputParameters: [kCIInputRadiusKey: 30])!) ship.filters = ciFilters Results in: Which, I thought ok maybe I'm using the CIFilter incorrectly. However CIHalftone works fine: ciFilters.append(CIFilter(name: "CICMYKHalftone", withInputParameters: ["inputWidth": 20])!) I've also