7

I don't think this is going to be quite as easy as you'd like, that said you should be able to copy/paste the code below to get something going. There might be a better way to approach this, but as I see it you'll need 2 render passes. The first to render the scene to a low resolution to introduce pixelation, and a second to resample the low resolution ...


3

Yup! As of iOS 9, you can set a SceneKit SCNView to use a Metal renderer on devices that support it by initializing it with the SCNPreferredRenderingAPIKey key in the options dictionary, as described here. Something along these lines should work: let sceneView = SCNView(frame: someFrame, options:[SCNPreferredRenderingAPIKey: NSNumber(unsignedInteger: ...


3

In a 4x4 transformation matrix, all directions are contained: First row of matrix contains the x-axis. Second row of the matrix contains the y-axis. Third row of the matrix contains the z-axis. Fourth row of the matrix contains the position/translation. Looking at your code, -z is the direction the camera looks at. Most likely, the y-axis in that ...


2

It's pretty straight forward really. When you increase the rate you increase the time it needed to calculate each in-game second by the same rate. One of the issue you can run into when increasing the simulation rate too much is that the delta per timestap can become too small and get rounded away. Increasing by a factor of 4 means it's only 2 bits but it ...


2

Try setting the material fillMode to .lines: sphereNode.geometry?.firstMaterial?.fillMode = .lines


2

Quick solution didn't turn out quite as well as I'd like, but I'll post it up regardless as it may help someone out. To get something that better matches your figure I believe you'll need to build your own SCNGeometry with probably a box for each line. This can be done, and there's several examples on building your own geometry around, but it is a fair bit ...


1

I do not use swift, but engine Cameras usually work with a frustum, which is a special type of collider, almost like a cone away from the camera, that decides what should be drawn and what shouldn't. Your camera appears to be culling (deciding not to draw) things that are far away from it, which suggests to me that the frustum is too short. The camera uses ...


1

I work on something similar and wondered about that as well. I wanted giant stars and supermassive black holes to be perceived as incredibly huge (which they are). My thought was that any star would "look" and behave the same if you simply stood further away. Meaning: A star with the diameter of 10 at a distance of 50 will look the same as a star with a ...


1

I would recommend either rescaling the scene so that things don’t get 600,000 units away, or adjust zNear in proportion to zFar. As the ratio of zFar:zNear gets greater, the depth buffer precision decreases, appearing as z-fighting in surfaces near each other. As the default ratio in SceneKit is 100:1, adjusting zNear to be on the order of 1000 would keep ...


1

The simulation rate is essentially as follows: how many times per second are you calculating and updating your objects? If you're simulation rate is 10 times per second, you're taking all of your objects, updating their position by their velocty/10, and dealing with any forces and collisions. If you up that to 40 times per second, you're moving each object ...


1

Sounds like you need the Collada exporter which you can find on the Unity Asset Store to convert your models and scenes to .dae format for importing into SceneKit. There is one exporter for Unity 5.x and one for Unity 2017.


1

I am not using Vuforia but ARToolkit and I had the same kind of issue. The main solution is to realize that SceneKit is a graph of nodes, therefore applying a modelViewProjection to a node transform may not may so much sense. The node with the camera is your view. Instead, you should apply your projectionMatrix to the SCNCamera's projectionTransform ...


1

Finally I resolved issue. Issue is with the Xcode I uninstalled everything and installed again and its stared working perfectly. And also there are some memory leaks in OpenGL so that I released.


1

As the documentation specifies, the first 3 values will specify the 3d position of the axis for rotating the light, while the 4th parameter will specify the rotation around that axis. For instance, specifying (pseudo-code) (0, 0, 1, degToRad(45)) will have the effect of a light that will be rotated 45 degrees around the vertical axis (assuming that z is up),...


1

What you explain sounds reasonable. Generate a smaller sphere with the radius set for an appropriate sea level. Alternativly generate a sphere and alter its scale. This'd be quicker than regenerating a new one.


1

You should be able to animate the height using u_time in your shader. Example usage of u_time code in Xcode project download here - https://developer.apple.com/library/mac/samplecode/SceneKit_Slides_WWDC2013/Introduction/Intro.html (compiles to slide show, use -> key to goto slide 40-something) Can you help me out? I've been trying to do a height map ...


1

You need a 3d noise function (perlin,simplex,..). Call it f(x,y,z). Usualy this function returns a 0..1 float value. You simply decide your sea level float k in 0..1 and : Foreach point of the sphere If f(x,y,z) < k k is your heigth in that point Else f(x,y,z) is your heigth in that point


1

I found that it is because I was using a dynamic body rather than a kinematic body. I still have a bit of learning in regards to how physics works with scene kit.


Only top voted, non community-wiki answers of a minimum length are eligible