0
votes

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

1
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
@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. - Carlos C
could simply be view frustum culling on the near plane en.m.wikipedia.org/wiki/Viewing_frustum can't tell you how to fix it though, don't know scenekit - LearnCocos2D
you can adjust the frustum by changing the zNear and zFar properties of an SCNCamera. Here you want to decrease zNear. - mnuages
It apparently worked! Thank you @mnuages, can you post it as an answer or you want me to post it? - Carlos C

1 Answers

1
votes

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.