How to make SCNView render a new frame?

Is there a way to get SCNView to render a new frame on demand if there is no animation in the scene? If the scene is static, SCNView displays exactly once, and then only after something changes.

This usually makes sense, but I work with a Vuforia card, augmented by reality, which requires me to render a new frame every time it processes a new video frame from the camera. I worked on this issue by creating my own UIView with CAEAGLLayer, which displays the contents of SceneKit using SCNRenderer. This works fine, but I'm curious if there is a way to do this using SCNView, so I can avoid directly touching OpenGL ES.

+6
source share
3 answers

you can set your playing property to YES

+13
source

As a UIView, you can use the same mechanism to request updates as any other UIView: [_sceneView setNeedsDisplay]; However, as indicated, this should not be used as the primary way to manage updates, as it will not synchronize with the display.

0
source

You can increase sceneTime like this:

 sceneView.sceneTime += 1 

Then it will display one frame.

0
source

Source: https://habr.com/ru/post/977729/


All Articles