scenekit

Is there a way to chain SceneKit Animations?

喜你入骨 提交于 2021-01-28 21:51:51
问题 I’m looking for a way of chaining SceneKit animations. I’m adding x number of nodes to a scene, I’d like to add the first node, make it fade in and once it’s visible then we go to the next node until all nodes are visible. So I need the animation on the first node to end before we start on the second. Obviously I tried a for loop with SCNActions but the animation is batched together so all nodes appear at the same time. I don’t know how many nodes will be added, so I can’t make a sequence.

SceneKit - Remove stitching line in edges borders

帅比萌擦擦* 提交于 2021-01-28 18:22:11
问题 I'm displaying a texture on a cube (see SceneKit - Map cube texture to box) Things work well now, but the result show a light stitching line between some of the cube faces that I outlined here (you are inside the cube): Any idea how I can get rid of that? The input texture looks like So there is some discontinuity in the input. I'm using a custom SceneKit geometry that doesn't do much more than mapping this texture to a cube. You can find the relevant code in question mentioned above: https:/

Lock camera rotation around

谁说我不能喝 提交于 2021-01-28 11:55:37
问题 I am creating an app that uses SceneKit. The model is at a fixed location and the user can translate and rotate the camera around the scene. Translating works fine, and rotating the camera also works - as long as only one axis was rotated. When the camera faces down or up and the camera is rotated to the left or right, it not only rotates around that axis, but also around a second axis which looks really weird. I tried moving the pivot point, but that didn't help. Here is the code that I use

SceneKit stucks for a few frames, when SCNGeometry asset gets inside frustum of SCNCamera

孤街浪徒 提交于 2021-01-28 11:15:35
问题 I am working on a game in which a character runs along the screen and the camera is following the character. For each scene I add all the required assests and place them on scene. I do this behind a loading screen, because SceneKit needs some time to put all the stuff on scene. After like 5 seconds I fade out the screen (which is basically a black UIImage that lays in front of everything) and the game starts. Depending on the current scene, the amout of memory required is between 200MB and

scenekit - zoom in/out to selected node of scene

社会主义新天地 提交于 2021-01-28 10:50:01
问题 I have a scene in which a human body is displayed. I want to zoom in to a specific body part when a user taps on it. I changed the position of the camera to the position of Node but it points not exactly on it. Also I need to keep the selected part in center of the screen when zoom in. How can I accomplish zoom in / out? 回答1: To reposition it in a Z-axis you want to multiply the currents node matrix with the new matrix. var node = childNode.transform var translation =

scenekit - zoom in/out to selected node of scene

本小妞迷上赌 提交于 2021-01-28 10:48:37
问题 I have a scene in which a human body is displayed. I want to zoom in to a specific body part when a user taps on it. I changed the position of the camera to the position of Node but it points not exactly on it. Also I need to keep the selected part in center of the screen when zoom in. How can I accomplish zoom in / out? 回答1: To reposition it in a Z-axis you want to multiply the currents node matrix with the new matrix. var node = childNode.transform var translation =

scenekit - zoom in/out to selected node of scene

六眼飞鱼酱① 提交于 2021-01-28 10:43:52
问题 I have a scene in which a human body is displayed. I want to zoom in to a specific body part when a user taps on it. I changed the position of the camera to the position of Node but it points not exactly on it. Also I need to keep the selected part in center of the screen when zoom in. How can I accomplish zoom in / out? 回答1: To reposition it in a Z-axis you want to multiply the currents node matrix with the new matrix. var node = childNode.transform var translation =

Hide area of an SCNMaterial

懵懂的女人 提交于 2021-01-28 09:19:53
问题 I'm using SceneKit and ARKit 1.5, once a surface has been mapped I apply a material to it. I would like to only show what's under the camera in a certain radius with an alpha effect. I want to keep the material static meaning that it does not move when the camera moves, only the radius shape will move. What kind of technique could I use for this ? ArCore by Google does this perfectly. Actual rendering: Desired Rendering: ARCore example: (click to see GIF) Thank you! 回答1: I would use a shader

ARKit place node where finger press is

谁说我不能喝 提交于 2021-01-25 07:23:18
问题 I am working on an ios app with ARKit and I am wondering how to create a node exactly where I press my finger on the screen but approximately 0.5m into the screen. I know I will have to take into account the orientation of the device but I am still very confused on where to begin. Any help would be great! Thanks. 回答1: The solution is simple. Add a your required node as a child node to the camera with position vector (0,0,1). Now, save the world position of that node you created and

Antialiasing a SceneKit rendering with Metal

﹥>﹥吖頭↗ 提交于 2021-01-07 03:52:26
问题 I'm new to Metal. I'm rendering a SceneKit scene with Metal using this Apple sample code. TLDR; it calls the SCNRenderer's render function and passes in a command buffer. I'm compiling for Big Sur. It works, but it is not anti-aliased. I've tried a few ways to achieve it, as you can see in the updates below. Without Metal, I'd just set isJitteringEnabled to true on the SCNRenderer, and I get beautiful (and slow) 96-ish-pass renderings. If I try to do this with Metal, I get weird pixel format