I'm making an Augmented Reality app where the user has to throw a ball at a target. I used the following code to position the ball 10 cm in front of the screen:
var translation = matrix_identity_float4x4
translation.columns.3.z = -0.1
print(translation.debugDescription)
print(frame.camera.transform)
projectile.simdTransform = matrix_multiply(frame.camera.transform, translation)
Currently the game looks like this, but I want to move the ball to near the bottom of the screen.
I ended up finding a solution:
Replacing the following line:
translation.columns.3.z = -0.1
with:
translation.columns.3.x = -0.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With