scenekit

Inconsistent SceneKit framerate

做~自己de王妃 提交于 2019-11-27 02:46:45
问题 I'm seeing very inconsistent frame rates in the SceneKit starter project. Sometimes it runs constantly at 60 fps (12ms rendering, 6ms metal flush), and sometimes it runs constantly at 40 fps (20ms rendering, 6ms metal flush), no more, no less. The frame rate changes randomly when I reopen the app, and will stay at that frame rate until the next reopen. I tried switching to OpenGL ES, and while it seems to fix it in the starter project, I still see those drops in my real app. The starter

how to convert .dae to .scn files in SceneKit

限于喜欢 提交于 2019-11-27 00:14:13
问题 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) 回答1: Exporting the .dae is unnecessary;

Trouble subclassing SCNScene

前提是你 提交于 2019-11-26 23:24:21
问题 I've been trying to subclass SCNScene as that seems like the best place to keep my scene related logic. Now I'm not sure wether that's reccomended so my first question is - Should I be subclassing SCNScene, and if not why not? The documentation seems to suggest it's common but I've read comments online that suggest I shouldn't subclass it. Scrap that, I was looking at the documentation for SKScene . The SCNScene class reference makes no mention of subclassing. Assuming it's ok to structure my

identify face of a cube hit on touches began in Swift-Scene Kit

不问归期 提交于 2019-11-26 23:17:58
问题 I'm tying to create an app with Scene kit to solve Rubix Cube. I've my own dae file for the cube. Upon touches began I have the object that's been hit func tapGesture(sender: UITapGestureRecognizer){ // check what nodes are tapped var p = sender.locationInView(sceneView) var hitResults = sceneView.hitTest(p, options: nil) if hitResults.count > 0 { var hitnode = (hitResults.first)!.node print("\nName of node hit is \(hitnode.name)") //var indexvalue = hitResults.first?.faceIndex //print

iOS SceneKit Neon Glow

时间秒杀一切 提交于 2019-11-26 21:37:09
问题 Have been looking at lighting on Scenekit, and while I can now apply a lighting node to light something I'm looking for a way to light from within an object. As an example imagine a neon glow, or a lightbulb that casts light on other objects. Any ideas how to achieve this? Many thanks. 回答1: As @DavidRönnqvist hints in comments, there are multiple ways to make an object appear to glow. You can do these together or individually — you'll probably need to tweak how you combine them to get the

Custom SceneKit Geometry in Swift on iOS not working but equivalent Objective C code does

蓝咒 提交于 2019-11-26 20:57:42
问题 I am keen to adopt the new Swift language as this seems to be the way forward with Apple development. I have also been impressed with the new SceneKit support in iOS 8. I would like to programatically create custom geometry at runtime but I am struggling to get the Swift code to work. Yet the equivalent code in Objective C works OK. This could be a bug, or something I am doing wrong. I am simply trying to create and render a single triangle. I will ignore the normals and textures etc at this

ARKit: Placing an SCNText at a particular point in front of the camera

∥☆過路亽.° 提交于 2019-11-26 20:45:29
问题 I've managed to get a cube (SCNNode) placed on a surface where the camera is pointed, however I am finding it very difficult to do the simple (?) task of also placing text in the same position. I've created the SCNText and subsequent SCNNode, however when I add it to the rootNode the text always seems to be added above my head and off the camera to the right (which tells me thats the global origin point). Even when I use the exact same values of position I used for the the cube, the SCNText

cameranode rotate as iOS device moving

半腔热情 提交于 2019-11-26 20:18:03
问题 It's 360 degree video player project. I add a cameranode( SCNNode ) to a rootnode, the cameranode was put at the center(0,0,0) of the SCNSphere , It can play video by now. Now I have to use devicemotion. I need to rotate the camera when device moves. Not just rotate a certain angle. (Not just device move, When I'm holding a device, my moving regard as the device moving. because I found if I use deviceMotion.attitude.roll , the cameranode only moves when device moves by itself, not when I

Stroke Width with a SceneKit line primitive type

一个人想着一个人 提交于 2019-11-26 20:15:45
问题 I am trying to replicate this cube image shape (with permission from the original creator) using scene kit. Thus far, I have the drawing code for the lines and the vertices. I cannot use an image because the background has to be transparent. The specific I am trying to solve right now is how to edit the stroke width for the SCNGeometryPrimitiveType.Line element. The basic way I am creating lines is like this: private func squareVertices(length: Float) -> [SCNVector3] { let m = length/Float(2)

Position a SceneKit object in front of SCNCamera's current orientation

99封情书 提交于 2019-11-26 19:12:52
问题 I would like to create a new SceneKit node when the user taps the screen, and have it appear directly in front of the camera at a set distance. For testing, this will be a SCNText reads reads "you tapped here". It should also be at right angles to the line of sight - that is, "face on" to the camera. So, given the self.camera.orientation SCNVector4 (or similar), how can I: produce the SCNVector3 that puts the node in "front" of the camera at a given distance? produce the SCNVector4 (or