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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions ARImageTracking.xcodeproj/project.pbxproj
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
43653C8B25A853E400AD9879 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43653C8A25A853E400AD9879 /* AppDelegate.swift */; };
43653C8D25A853E400AD9879 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43653C8C25A853E400AD9879 /* ContentView.swift */; };
43653C8F25A853E400AD9879 /* Experience.rcproject in Sources */ = {isa = PBXBuildFile; fileRef = 43653C8E25A853E400AD9879 /* Experience.rcproject */; };
43653C9125A853E800AD9879 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 43653C9025A853E800AD9879 /* Assets.xcassets */; };
43653C9425A853E800AD9879 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 43653C9325A853E800AD9879 /* Preview Assets.xcassets */; };
43653C9D25A854E400AD9879 /* iphonevideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 43653C9C25A854E400AD9879 /* iphonevideo.mp4 */; };
Expand All @@ -19,7 +18,6 @@
43653C8725A853E400AD9879 /* ARImageTracking.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ARImageTracking.app; sourceTree = BUILT_PRODUCTS_DIR; };
43653C8A25A853E400AD9879 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
43653C8C25A853E400AD9879 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
43653C8E25A853E400AD9879 /* Experience.rcproject */ = {isa = PBXFileReference; lastKnownFileType = file.rcproject; path = Experience.rcproject; sourceTree = "<group>"; };
43653C9025A853E800AD9879 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
43653C9325A853E800AD9879 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
43653C9525A853E800AD9879 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -59,7 +57,6 @@
43653C8A25A853E400AD9879 /* AppDelegate.swift */,
43653C8C25A853E400AD9879 /* ContentView.swift */,
43653C9C25A854E400AD9879 /* iphonevideo.mp4 */,
43653C8E25A853E400AD9879 /* Experience.rcproject */,
43653C9025A853E800AD9879 /* Assets.xcassets */,
43653C9525A853E800AD9879 /* Info.plist */,
43653C9225A853E800AD9879 /* Preview Content */,
Expand Down Expand Up @@ -147,7 +144,6 @@
files = (
43653C8D25A853E400AD9879 /* ContentView.swift in Sources */,
43653C8B25A853E400AD9879 /* AppDelegate.swift in Sources */,
43653C8F25A853E400AD9879 /* Experience.rcproject in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -277,7 +273,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"ARImageTracking/Preview Content\"";
DEVELOPMENT_TEAM = G6E5589J7L;
DEVELOPMENT_TEAM = GGXD5E6AF8;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = ARImageTracking/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -298,7 +294,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"ARImageTracking/Preview Content\"";
DEVELOPMENT_TEAM = G6E5589J7L;
DEVELOPMENT_TEAM = GGXD5E6AF8;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = ARImageTracking/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
Binary file not shown.
8 changes: 6 additions & 2 deletions ARImageTracking/ContentView.swift
Expand Up @@ -47,9 +47,13 @@ struct ARViewContainer: UIViewRepresentable {
let playerItem = AVPlayerItem(url: videoURL)
videoPlayer = AVPlayer(playerItem: playerItem)
let videoMaterial = VideoMaterial(avPlayer: videoPlayer)


// 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)

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: 3, depth: 6.5, cornerRadius: 0.3), materials: [videoMaterial])
let videoPlane = ModelEntity(mesh: .generatePlane(width: width, depth: height, cornerRadius: 0.3), materials: [videoMaterial])

//Assigns reference image that will be detected
if let imageName = imageAnchor.name, imageName == "xs" {
Expand Down

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
155 changes: 0 additions & 155 deletions ARImageTracking/Experience.rcproject/com.apple.RCFoundation.Project

This file was deleted.

1 change: 1 addition & 0 deletions ARImageTracking/Info.plist
Expand Up @@ -20,6 +20,7 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>

<key>NSCameraUsageDescription</key>
<string></string>
<key>UIApplicationSupportsIndirectInputEvents</key>
Expand Down