[英]How can I draw a curve between two points in ARKit with Xcode?
I'm developing an app that helps in throwing paper waste in dustbin.我正在开发一个应用程序,有助于将废纸扔进垃圾箱。
How do I draw a curve between two points in AR world?如何在 AR 世界中的两点之间绘制曲线?
I'm using Xcode and ARKit.我正在使用 Xcode 和 ARKit。 Any help will be greatly appreciated.
任何帮助将不胜感激。
UPDATE: See the image below, the curve shown in white dotted line is what I want to achieve in ar更新:见下图,白色虚线所示的曲线是我想在ar中实现的
This has nothing to do with ARKit, it is a pure SceneKit question.这与 ARKit 无关,这是一个纯粹的 SceneKit 问题。 You need to apply Physics Simulation to the paper ball you are throwing.
您需要将物理模拟应用于您投掷的纸球。
You then use the function applyForce(_:asImpulse:)
to throw the ball.然后使用函数
applyForce(_:asImpulse:)
扔球。 The curve will be a result of the force applied and gravity of the scene.曲线将是施加的力和场景重力的结果。
The ball will have a SCNPhysicsBodyType.dynamic
and the rest of the scene can have SCNPhysicsBodyType.static
as they don't move (floor, bin , desk, etc...).球将具有
SCNPhysicsBodyType.dynamic
并且场景的其余部分可以具有SCNPhysicsBodyType.static
因为它们不会移动(地板、垃圾箱、桌子等...)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.