scenekit

ARKit – Spatial Audio barely changes the volume over distance

大城市里の小女人 提交于 2021-02-08 07:17:38
问题 I created a SCNNode and added an Audio to it. It is a Mono audio. Everything is set up correctly. It is working as Spatial Audio, that's not the problem. The problem is that as i get closer or far away it barely changes the volume. I know it changes if i get very very far away, but it's nothing like Apple demonstrated here: https://youtu.be/d9kb1LfNNU4?t=23 Some other games i see the audio volume really changing from one step distance. With mine, with one step you can't even tell the volume

How to use “*.scnp” file in SwiftUI for button click (iOS)?

风格不统一 提交于 2021-02-08 05:56:06
问题 I have "Explode.scnp" SceneKit file. It's already configured, the texture has been set. How we can use it in SwiftUI? For example, after the button clicks the background will be animated once. var body: some View { ZStack { VStack { Button(action: { Particles() }) { Text("Animate") } } } } This code works for scn. but how to use it with scnp? import SwiftUI import SceneKit struct ScenekitView : UIViewRepresentable { let scene = SCNScene(named: "art.scnassets/ship.scn")! func makeUIView

How to use “*.scnp” file in SwiftUI for button click (iOS)?

最后都变了- 提交于 2021-02-08 05:55:55
问题 I have "Explode.scnp" SceneKit file. It's already configured, the texture has been set. How we can use it in SwiftUI? For example, after the button clicks the background will be animated once. var body: some View { ZStack { VStack { Button(action: { Particles() }) { Text("Animate") } } } } This code works for scn. but how to use it with scnp? import SwiftUI import SceneKit struct ScenekitView : UIViewRepresentable { let scene = SCNScene(named: "art.scnassets/ship.scn")! func makeUIView

Getting an SCNNode's bounding volume with rotation

为君一笑 提交于 2021-02-07 09:00:26
问题 I have a very simple scene set up using the XCode level editor. As you can see, one of the 1x5 rectangular cuboids has been rotated by 90º. This was achieved by setting the y attribute of the Euler Angles property to 90 in the Node Inspector. But notice that the Bounding Box doesn't account for the cuboids rotation. This is also the case when I iterate through the SCNNodes in the scene. Both cuboids have the same Bounding Volumne for wall:SCNNode in walls.childNodes { var v1 = SCNVector3Zero

Getting an SCNNode's bounding volume with rotation

青春壹個敷衍的年華 提交于 2021-02-07 08:58:35
问题 I have a very simple scene set up using the XCode level editor. As you can see, one of the 1x5 rectangular cuboids has been rotated by 90º. This was achieved by setting the y attribute of the Euler Angles property to 90 in the Node Inspector. But notice that the Bounding Box doesn't account for the cuboids rotation. This is also the case when I iterate through the SCNNodes in the scene. Both cuboids have the same Bounding Volumne for wall:SCNNode in walls.childNodes { var v1 = SCNVector3Zero

Getting an SCNNode's bounding volume with rotation

旧城冷巷雨未停 提交于 2021-02-07 08:57:13
问题 I have a very simple scene set up using the XCode level editor. As you can see, one of the 1x5 rectangular cuboids has been rotated by 90º. This was achieved by setting the y attribute of the Euler Angles property to 90 in the Node Inspector. But notice that the Bounding Box doesn't account for the cuboids rotation. This is also the case when I iterate through the SCNNodes in the scene. Both cuboids have the same Bounding Volumne for wall:SCNNode in walls.childNodes { var v1 = SCNVector3Zero

How to scale DAE models correctly in ARKit and SceneKit?

牧云@^-^@ 提交于 2021-02-07 08:41:24
问题 I'm currently trying to combine the following sources: Apples SceneKit Vehicle Demo, Resp. its Swift version, ARKit by example, and resp. its Swift version. Each project on its own works like a charm (although I changed the vehicle demo so that the car can be controlled by on-screen buttons). Now, when I try to combine both projects to create an augmented reality racing game, I run into problems regarding the size of the .dae model of the car: it's too big. I can scale the model using the

SCNText Alignment not working in iOS

随声附和 提交于 2021-02-07 07:19:42
问题 I tried right alignment, but it's still left aligned. let txt = SCNText(string: "TEST", extrusionDepth: 10) txt.chamferRadius = 5 //0<chamfer<extrusion depth txt.firstMaterial.diffuse.contents = UIColor.whiteColor() txt.containerFrame = CGRectMake(-200, -150, 400, 200) //on iPad Air Sim in Landscape txt.wrapped = true txt.alignmentMode = kCAAlignmentRight What is wrong? Thanks! 回答1: It looks like alignment is working -- try adding a second line to your test string like "TEST\nT" and switching

Check if SCNNode SCNAction is finished

爷,独闯天下 提交于 2021-02-07 03:15:05
问题 I have created a SceneKit 3D maze world in which a player can move. Some of the moves like jumping involve moving the camera up and down while changing to view direction over a period of time of several seconds. During this time I would like to ignore taps and swipes by the user that would normally result in other types of movements like turning and moving forward. I could create a timer that matches the jump duration and sets a Bool but I was hoping for a simplier way of checking the SCNNode

Check if SCNNode SCNAction is finished

南笙酒味 提交于 2021-02-07 03:13:15
问题 I have created a SceneKit 3D maze world in which a player can move. Some of the moves like jumping involve moving the camera up and down while changing to view direction over a period of time of several seconds. During this time I would like to ignore taps and swipes by the user that would normally result in other types of movements like turning and moving forward. I could create a timer that matches the jump duration and sets a Bool but I was hoping for a simplier way of checking the SCNNode