SceneKit, ARKit and Swift 4 - Basics Tutorial - Part 1

preview_player
Показать описание


In this first video tutorial using the ARKit and SceneKit template, we'll remove the starting assets and build a simple box and ball scene. We will use Swift 4 to program the ball to have a physics body affected by gravity so it then drops onto the box, which has a static physics body. You'll learn how to setup objects in the Scene Editor, then enumerate through the children in the scene to find those objects by name with Swift. We'll also discuss some debug options, like seeing the world origin, physics bodies, and augmented reality feature points.
Рекомендации по теме
Комментарии
Автор

Thanks for the tutorial. I followed it but found that the ball behaves oddly - it doesn't actually quite touch the box, and doesn't roll properly if you incline the box. Took me a while to figure out why, but the physics shapes that the code sets are rough approximations - and you can see this at the end of the video, where the ball's physics shape shows as a pointy something-a-hedron. All those vertices and flat faces mean it rolls more like a dice and will settle on a face. Turns out that if we pass nil as the shape parameter when creating the SCNPhysicsBody, it will automatically decide on the best geometry to use, and for a sphere it will use a mathematical understanding of what a true sphere is - resulting in simpler, faster physics but more accurate ball behaviour. Try it!

SamCarr-ykjg
Автор

Can you talk about how ARKit works with SceneKit?

BABEENGINEER
Автор

OMG! Great video! I showed this video in class and it helped us so much, so thanks! Lots of support from Russia.

We have a question if you don't mind, do you know how we could use ar to automatically measure somebody's height? We would want to point the camera at a person and it to measure their height automatically, do you know how to do that by any chance?

Don't worry if you don't get around to answering this, you are probably very busy. Thanks so much anyways and continue with the great content!

Mike-vjdo
Автор

My "Box" and "Ball" children start out super large. No where near as small as your example on the scene graph. I can't figure out how to fix that.

DukeOBass
Автор

I wasn't even able to rename the new .scn -.-

SIsForSteppi
welcome to shbcf.ru