public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. if (View is GLKView) { EAGLContext.SetCurrentContext(((GLKView)View).Context); _videoMesh = new VideoMesh(this); string mediaBundlePath = NSBundle.MainBundle.BundlePath + "/media.bundle"; NSBundle mediaBundle = new NSBundle(mediaBundlePath); _videoMesh.InitMesh(mediaBundle.PathForResource("pikkart_video", "mp4"), mediaBundle.PathForResource("pikkart_keyframe", "png"), 0, false, null); } UITapGestureRecognizer tapGesture = new UITapGestureRecognizer((obj) => { playOrPauseVideo(); }); View.AddGestureRecognizer(tapGesture); string[] dbNames = { "" }; PKTCloudRecognitionInfo info = new PKTCloudRecognitionInfo(dbNames); PKTRecognitionOptions options = new PKTRecognitionOptions(PKTRecognitionStorage.PKTLOCAL, PKTRecognitionMode.PKTRECOGNITION_CONTINUOS_SCAN, info); ApplyCameraGlOrientation(UIApplication.SharedApplication.StatusBarOrientation); StartRecognition(options, this); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. if (View is GLKView) { EAGLContext.SetCurrentContext(((GLKView)View).Context); /* * _monkeyMeshYellow = Mesh(meshFile: Bundle.main.path(forResource: "monkey", ofType: "json")!, * textureFile: Bundle.main.path(forResource: "texture", ofType: "png")!) * _monkeyMeshBlue = Mesh(meshFile: Bundle.main.path(forResource: "monkey", ofType: "json")!, * textureFile: Bundle.main.path(forResource: "texture2", ofType: "png")!) * _monkeyMeshRed = Mesh(meshFile: Bundle.main.path(forResource: "monkey", ofType: "json")!, * textureFile: Bundle.main.path(forResource: "texture3", ofType: "png")!) * _monkeyMeshGray = Mesh(meshFile: Bundle.main.path(forResource: "monkey", ofType: "json")!, * textureFile: Bundle.main.path(forResource: "texturegray", ofType: "png")!) */ string meshFile = NSBundle.MainBundle.PathForResource("monkey", "json"); string textureFile = NSBundle.MainBundle.PathForResource("texture", "png"); string textureFile2 = NSBundle.MainBundle.PathForResource("texture2", "png"); string textureFile3 = NSBundle.MainBundle.PathForResource("texture3", "png"); string textureFileGray = NSBundle.MainBundle.PathForResource("texturegray", "png"); mMonkeyMeshYellow = new Mesh(); mMonkeyMeshYellow.InitMesh(meshFile, textureFile); mMonkeyMeshYellow.LoadMesh(); mMonkeyMeshBlue = new Mesh(); mMonkeyMeshBlue.InitMesh(meshFile, textureFile2); mMonkeyMeshBlue.LoadMesh(); mMonkeyMeshRed = new Mesh(); mMonkeyMeshRed.InitMesh(meshFile, textureFile3); mMonkeyMeshRed.LoadMesh(); mMonkeyMeshGray = new Mesh(); mMonkeyMeshGray.InitMesh(meshFile, textureFileGray); mMonkeyMeshGray.LoadMesh(); mMonkeyMesh = mMonkeyMeshGray; GL.ClearColor(1, 1, 1, 1); } string[] dbNames = { "" }; PKTCloudRecognitionInfo info = new PKTCloudRecognitionInfo(dbNames); PKTRecognitionOptions options = new PKTRecognitionOptions(PKTRecognitionStorage.PKTLOCAL, PKTRecognitionMode.PKTRECOGNITION_CONTINUOS_SCAN, info); ApplyCameraGlOrientation(UIApplication.SharedApplication.StatusBarOrientation); StartRecognition(options, this); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. if (View is GLKView) { EAGLContext.SetCurrentContext(((GLKView)View).Context); string meshFile = NSBundle.MainBundle.PathForResource("monkey", "json"); string textureFile = NSBundle.MainBundle.PathForResource("texture", "png"); mMonkeyMesh = new Mesh(); mMonkeyMesh.InitMesh(meshFile, textureFile); mMonkeyMesh.LoadMesh(); GL.ClearColor(1, 1, 1, 1); } string[] dbNames = { "" }; PKTCloudRecognitionInfo info = new PKTCloudRecognitionInfo(dbNames); PKTRecognitionOptions options = new PKTRecognitionOptions(PKTRecognitionStorage.PKTLOCAL, PKTRecognitionMode.PKTRECOGNITION_CONTINUOS_SCAN, info); ApplyCameraGlOrientation(UIApplication.SharedApplication.StatusBarOrientation); StartRecognition(options, this); }