0

I'm having a problem with big SCNNodes, they are getting cut like this:

I do not want this to happen :(

How do I avoid this? Is it something to do with the camera? With the SCNView size? With the size of the SCNNode?

The SCNNode has this scale:

node.scale = SCNVector3Make(100, 1, 100);

It's a tile-based game, and I'm just making a huge tile of the original to cover the background, plus I'll be adding mountains, and so other stuff and want lightning so I cannot just put a plain background image.

Thank you in advance!

EDIT:

Here's another example of my problem, there suppose to be full mountains drawn here, but they get cut off.

Another example of the problem

c4b4d4
  • 964
  • 12
  • 32
  • I don't know how you expect that object to look. In what way is it being cut? Not being rendered beyond a certain distance from the camera? – David Rönnqvist Jan 03 '15 at 16:42
  • @DavidRönnqvist Just uploaded a new image with another example of my problem, maybe it's really simple to solve it and I just need to change a value but I don't know which and can't find anything on the web nor docs. – c4b4d4 Jan 03 '15 at 20:08
  • could simply be view frustum culling on the near plane http://en.m.wikipedia.org/wiki/Viewing_frustum can't tell you how to fix it though, don't know scenekit – CodeSmile Jan 04 '15 at 10:16
  • you can adjust the frustum by changing the `zNear` and `zFar` properties of an `SCNCamera`. Here you want to decrease `zNear`. – mnuages Jan 04 '15 at 17:08
  • It apparently worked! Thank you @mnuages, can you post it as an answer or you want me to post it? – c4b4d4 Jan 04 '15 at 18:25

1 Answers1

1

Set the automaticallyAdjustsZRange property of your SCNCamera to true and it will ensure that nothing is clipped because of the wrong zNear or zFar being set.