ios-samples icon indicating copy to clipboard operation
ios-samples copied to clipboard

Image plane incorrect positioning in ARKitSample project

Open andynorton opened this issue 6 years ago • 2 comments

In ios11/ARKitSample/ARKitSample/GameViewController.cs

After running the code, it works as expected until I tap on the screen, the gesture recognize event is called and it works fine the first time - I get a plane node with a snapshot of the screen. But when this is called the second time, instead of creating a new node at the location of the second tap, it overlaps the initial child node.

The behaviour is different from the original version demoed here - https://youtu.be/LLRweyZ1KpA?t=1380

Example behaviour after a few screen taps: IMG_3058

andynorton avatar May 28 '19 08:05 andynorton

I can confirm that there appears to be something wrong with this sample. Tapping did nothing for me, despite the fact that we are hitting HandleTap

chamons avatar May 30 '19 21:05 chamons

The initial positioning of the photo node should be just in front of the camera, but with this sample it's probably putting it just behind the camera when you tried it but nothing happened.

I think we're missing some sort of position settings after

planeNode.Transform = SCNMatrix4.Mult(cameraTranslation, translation);

I can kind-of get a solution with

planeNode.Transform = SCNMatrix4.Mult(cameraTranslation, translation); planeNode.Position = cameraTranslation.Column3.Xyz;

But it needs some additional work to rotate the node into the same position as the ARCamera.

andynorton avatar May 31 '19 13:05 andynorton