scenekit

What does the “simd” prefix mean in SceneKit?

北城余情 提交于 2019-11-28 17:58:11
There is a SCNNode category named SCNNode(SIMD) , which declares some properties like simdPosition , simdRotation and so on. It seems these are duplicated properties of the original/normal properties position and rotation . @property(nonatomic) simd_float3 simdPosition API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); @property(nonatomic) simd_float4 simdRotation API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); What's the difference between position and simdPosition ? What does the prefix "simd" mean exactly? SIMD: Single Instruction Multiple Data SIMD

Code Signing Error Whenever I try replacing stock files in new SceneKit application

蓝咒 提交于 2019-11-28 17:32:21
So Xcode 8 was recently released and I'm still unsure as to what exactly might be causing this problem (it might be just the fact that it's a beta version of Xcode or perhaps that I'm somehow doing something incorrectly). The problem at hand is that I'm trying to create a new SceneKit application and I'm currently messing around with the .scn files. I created a .scn file, "hero.scn" inside of a "hero.scnassets" and also provided a .png file inside of the hero.scnassets folder by the name of "heroTexture.png" The code normally provided by Xcode 8.0 beta 1 for this project in the

Rendering a SceneKit scene to video output

为君一笑 提交于 2019-11-28 17:20:23
As a primarily high-level/iOS dev, I'm interested in using SceneKit for animation projects. I've been having fun with SceneKit for some months now, despite it obviously being designed for 'live' interaction, I would find it incredibly useful to be able to 'render' an SKScene to video. Currently, I've been using Quicktime's screen recorder to capture video output, but (of course) the frame-rate drops in doing so. Is there an alternative that allows a scene to be rendered at its own pace and outputted as a smooth video file? I understand this is unlikely to be possible... Just thought I'd ask in

how to convert .dae to .scn files in SceneKit

浪尽此生 提交于 2019-11-28 16:40:51
This is a screenshot from Apple's Fox sample code. As you can see, they use .scn file format for graphics object. They explicitly state in the wwdc2015 video that this was done by an artist. So far I only worked with .dae and was until recently convinced that this is the only supported format. My question is, how do I export objects stored in .dae file to .scn file? EDIT: this is what I get if go to Editor-> Convert to SceneKit scene file format (.scn) 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

iOS revert camera projection

佐手、 提交于 2019-11-28 15:15:43
I'm trying to estimate my device position related to a QR code in space. I'm using ARKit and the Vision framework, both introduced in iOS11, but the answer to this question probably doesn't depend on them. With the Vision framework, I'm able to get the rectangle that bounds a QR code in the camera frame. I'd like to match this rectangle to the device translation and rotation necessary to transform the QR code from a standard position. For instance if I observe the frame: * * B C A D * * while if I was 1m away from the QR code, centered on it, and assuming the QR code has a side of 10cm I'd see

Transform and Rotate in Scenekit

一个人想着一个人 提交于 2019-11-28 14:14:15
I have a SCN Node that I have Transformed to a desired Rotation and Angle. I now want to rotate it infinitely on its new x-axis, but I can't seem to get it to rotate 360 degrees, it just shifts slightly. let spin = CABasicAnimation(keyPath: "rotation") spin.fromValue = NSValue(SCNVector4: SCNVector4(x: item.rotation.x, y: item.rotation.y, z: item.rotation.z, w: item.rotation.w)) spin.toValue = NSValue(SCNVector4: SCNVector4(x: Float(2*M_PI), y: item.rotation.y, z: item.rotation.z, w: item.rotation.w)) spin.duration = 3 spin.repeatCount = .infinity item.addAnimation(spin, forKey: "spin around")

Fish Eye Wide-angle with a Scene Kit Camera: Possible?

↘锁芯ラ 提交于 2019-11-28 13:29:23
How do I get a distortion like what a fisheye lens does to a view with a SCNCamera in Scene Kit? Something like this kind of "bowing" of the imagery: // as Rickster pointed out, this kind of distortion is known as "Barrel Distortion". From the docs, this is the part that got me intrigued by the possibility of doing this kind of distortion with the camera: If you compute your own projection transform matrix, you can use this method to set it directly, overriding the transformation synthesized from the camera’s geometric properties. Unfortunately I know nothing about the powers and possibilities

Using shader modifiers to animate texture in SceneKit leads to jittery textures over time

怎甘沉沦 提交于 2019-11-28 12:53:02
I'm writing a scene in SceneKit for iOS. I'm trying to apply a texture to an object using a sprite sheet. I iterate through the images in that sheet with this code: happyMaterial = [SCNMaterial new]; happyMaterial.diffuse.contents = happyImage; happyMaterial.diffuse.wrapS = SCNWrapModeRepeat; happyMaterial.diffuse.wrapT = SCNWrapModeRepeat; happyMaterial.shaderModifiers = @{ SCNShaderModifierEntryPointGeometry : @"_geometry.texcoords[0] = vec2((_geometry.texcoords[0].x+floor(u_time*30.0))/10.0, (_geometry.texcoords[0].y+floor(u_time*30.0/10.0))/7.0);" }; All is good. Except over time, the

How can I overlay a SKScene over a SCNScene in Swift?

你说的曾经没有我的故事 提交于 2019-11-28 12:17:33
There are some overlay tutorials on the Internet, all using overlaySKScene at some point. That is somehow not possible in my project, as (I guess) my view does not use the constructor of SCNView at any point (which overlaySKScene is a part of). In the ViewController's viewDidLoad, basically only the MainScene is created: viewDidLoad() { self.sceneView = MainScene(view: self.view)) } ...which goes here (note: SCNScene instead of SCNView): class MainScene: SCNScene, SCNPhysicsContactDelegate {... init(view:UIView) { scnView = view as! SCNView super.init() scnView.scene = self; (...) } The scene

Xcode 7 SceneKit object's position property does not update when moved?

血红的双手。 提交于 2019-11-28 11:50:44
问题 So I'm making a game and in said game, you will use a DPad to move your ball around the scene. I'm using Xcode 7 Beta 5 though the same problem existed in beta 4. Here is the code of a test view controller: class TestController: UIViewController,DPadDelegate { @IBOutlet var scnView:SCNView! @IBOutlet var dpad:DPad! var timer:NSTimer? var update:NSTimer? var colors = [UIColor.blueColor(),UIColor.redColor(),UIColor.whiteColor(),UIColor.yellowColor(),UIColor.cyanColor(),UIColor.orangeColor()