Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some fixes #1

Merged
Merged

Conversation

multitudes
Copy link
Contributor

First of all thank you for this repo! :)

It did help me understand how to get RealityKit working with SwiftUI and ImageTracking!

I found that when running it on my iPhone the main view was cropped (sorry for the cable mess...

screenshot

To fix this I added this in the .plist

	<key>UILaunchScreen</key>
	<dict/>

and then I added the sizes of the video to match the sizes of the image. This might be unwanted though if you plan to use different videos

// size of video plane depending of the image
			let width: Float = Float(imageAnchor.referenceImage.physicalSize.width * 1.1)
			let height: Float = Float(imageAnchor.referenceImage.physicalSize.height * 1.1)

            //Sets the aspect ratio of the video to be played, and the corner radius of the video
            let videoPlane = ModelEntity(mesh: .generatePlane(width: width, depth: height, cornerRadius: 0.3), materials: [videoMaterial])

Copy link
Owner

@riccqi riccqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I'm very new to merging PRs so let me know if I'm doing anything wrong haha



// size of video plane depending of the image
let width: Float = Float(imageAnchor.referenceImage.physicalSize.width * 1.1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change the value of 1.1 to 1.03 for both width and height? that seems to be the magic number for me after testing (for the video to fit the iPhone box perfectly)

Copy link
Contributor Author

@multitudes multitudes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi riccqi, I did as you asked :). sorry I am not a pro with GitHub merging and PR's neither ;)
You are totally right that the size should be 1.03. I had forgotten you use the iPhone packaging. I use the image and it did some flickering at the edges, this is why I made it bit bigger, but reverted now to 1.03.
Have a nice day :)

I hope you don't get conflict with the project.pbxproj file. I should maybe remove it. Let me know

@riccqi riccqi merged commit b6d9cd1 into riccqi:main Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants