- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个由 Unity3D 生成的 xCode 项目(其中包括一个动画),我已经集成了用于显示动画(增强现实)的 vuforia SDK
我现在遇到的问题是在我的应用程序的相机屏幕和仪表板之间添加导航。
在 int OpenEAGL_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight, int* openglesVersion)
方法中,我实用地添加了后退按钮,例如:
if (wrapperObj == nil)
{
wrapperObj = [[WrapperClass alloc] init];
}
[backButton addTarget:wrapperObj action:@selector(goToDashBoard:) forControlEvents:UIControlEventTouchUpInside];
将其传递给包装类
@interface WrapperClass : NSObject
@property (nonatomic, retain) UINavigationController *navigation;
-(void)goToDashBoard:(UIButton*)sender;
@end
void goToPreviousScreen()
{
}
@implementation WrapperClass
@synthesize navigation;
-(void) goToDashBoard:(UIButton*)sender
{
[[self navigation] popViewControllerAnimated:YES];
goToPreviousScreen();
}
@end
谁能告诉我如何启动和运行导航的解决方案?
更新
尝试以这种方式弹出 View 时:
AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate.navigationController popToRootViewControllerAnimated:YES];
我得到这个日志:
2012-12-05 16:20:45.502 arapp[5993:907] <HomeViewController: 0x246db00>
StopQCAR
(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
Could not deactivate dataset.
(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
Could not destroy dataset.
(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
Could not deinitialize the tracker.
(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
Could not deinitialize the tracker.
(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)
ghashtable.c:294: assertion 'hash != NULL' failed
最佳答案
如果我正确理解你的问题,你正试图通过向它添加文件、 View Controller 、代码等来修改 Unity 构建的 Xcode 项目。根据我的经验,这不是一个好主意,您最好尽可能在 Unity 中构建您的应用程序。 Vuforia 论坛的版主也强烈反对它。我以这种方式构建了一个 Unity/Vuforia 应用程序,主要是为了避免花时间学习如何使用 C# 在 Unity 中执行此操作。我最终遇到了无法追踪的内存泄漏,不得不硬着头皮回到 Unity 并学习 Unity 脚本。当然有很多 iOS 的事情你不能在 Unity 中做,我不知道你的应用程序是做什么的,但是有很多插件可以帮助你,我结束了学习如何编写自己的插件来获得一些 iOS 功能我需要。
但是,如果你想像我那样在 AR View 和其他 View Controller 之间导航,那就是制作另一个 viewController,它基本上是一个覆盖层,只包含用于导航的按钮。然后我初始化它并将它作为 subview 添加到 UnityViewController。然后添加代码以转到所需的任何 View ,例如仪表板。
// Init Vuforia VC, then add its view as subview to "view" AR view, line 524
VuforiaViewController *vuforia = [[VuforiaViewController alloc] init];
// Create a full-screen window
_window = [[UIWindow alloc] initWithFrame:rect];
EAGLView* view = [[EAGLView alloc] initWithFrame:rect];
UnityViewController *controller = [[UnityViewController alloc] init];
sGLViewController = controller;
sGLView = view;
controller.view = view;
_splashView = [ [UIImageView alloc] initWithFrame: [[UIScreen mainScreen] bounds] ];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
_splashView.image = [UIImage imageNamed:SplashViewImage(UIInterfaceOrientationPortrait)];
}
else
{
_splashView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_splashView.autoresizesSubviews = YES;
}
[view addSubview:_splashView];
[view addSubview:vuforia.view]; // Overlay view added as subview of AR view
如您所知,您可以在 AppController 中注释掉 startUnity() 以防止在应用程序启动时出现 AR View ,并在另一个 VC 中调用它以返回到 AR View 。这种方法让我可以在 AR View 和其他几个 VC 之间导航,但最终应用程序不稳定,必须用完全在 Unity 中构建的应用程序替换。也许您可以找到更好的方法,但您最好还是深入研究 Unity 和插件,具体取决于您希望您的应用执行的操作。希望这可以帮助。
关于iphone - vuforia 和 uinavigationcontroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13587741/
我总是收到错误,并且总是说使用 Java Vuforia API 需要通过 com.vuforia.Vuforia 类进行初始化。我不知道如何初始化。任何人都可以帮助我吗?提前致谢。我收到错误的行是
我能够跟踪石头和碎片图像,但是当我使用目标管理器创建自己的目标图像时,我无法跟踪图像。我导入了数据库。它有 5 星级评级。但图像没有被识别。我对此很陌生。 我还需要做什么来跟踪自定义目标图像? 最佳答
我想使用 Vuforia 检测标记并在其上放置一个 3d 对象。从那时起,我想在我的应用程序中使用 ARKit。我如何知道检测到的标记或 3d 对象的 ARKit 世界变换? 我正在使用相同的 Vie
有人能说出在 eclipse 或 android studio 中使用 vuforia sdk 开发应用与使用 vuforia 扩展统一开发之间的区别吗? 在性能、应用大小等方面... 编辑: 我正在
如何在 Vuforia Image Target 示例中更改带有文本内容的茶壶? 该示例位于:https://developer.vuforia.com/resources/sample-apps/i
我正在制作增强现实游戏,我使用了 vuforia sdk。 这是我的问题: 我可以使用 vuforia 的增强现实并将其上传到 App Store 和 Playstore 吗? 最佳答案 vufori
我学习增强现实,但遇到了问题。我想使用一个图像目标,但我有很多图片(在我的 vuforia 数据库中)。我只能阅读一张图片,但这对我来说是个问题。我必须扫描很多标记(我会读取不同的标记,但一个图像目标
我正在尝试使用 Vuforia 视频播放示例应用程序作为大学项目的起点。我想做的是开发一个基于 iOS 的小型应用程序,该应用程序将识别我定义的目标,并根据示例应用程序在目标上播放我选择的视频。我是
我正在使用 Vuforia SDK 构建 Android 应用程序,并且很好奇标记跟踪的工作原理。该应用程序是否将视频帧转换为字节码,然后将这些与通过创建标记生成的 .dat 文件进行比较?此外,在
您好,我正在尝试使用 Vuforia SDK 开发一个 iOS 应用程序,但是我在哪里可以找到开始集成此 SDK 的方法?我查看了 Vuforia 网站,但没有关于如何将 SDK 集成到我的应用程序中
我有一个 AR 应用程序,它有 4 个图像目标,每个图像目标都有一个对应的视频,当它被识别时会在它上面播放。问题在于,即使在识别图像时显示正确的动画,也会播放所有其他动画,即使它们没有显示。因此,每当
是否可以在没有摄像头的情况下使用 Vuforia 进行图像跟踪? 基本上我想要一个函数,我可以用图像作为 indata 参数和图像目标的坐标作为结果来调用。存在吗? 最佳答案 不幸的是,这是不可能的。
我遇到了一个集成 three.js 和 Vuforia 的问题,我真的不知道如何解决这个问题,因为我对 OpenGl 真的一无所知。 我们正在开发一个小型 AR 应用程序,我们希望使用 Vuforia
我正在使用 Untiy 使用 Vuforia 为 HoloLens 构建 AR 应用程序。 我正在使用标记来放置多个对象以引用标记位置。没什么了不起的。还没有写脚本。 不时弹出以下错误消息。我不知道是
我正在尝试探索 Vuforia API,但文档仅解释了方法/类的用途。例如,如果我想了解如何自己扫描对象并将其添加到数据集中,我首先应该知道什么?是否有任何简单的教程可以开始(最好是 Android,
我打算为 Android 设备编写一个增强现实应用程序。 QualComm 的“Vuforia”似乎是一个好的开始,但我有一些问题他们的网站无法回答。由于支持 Android 2.1 及更高版本,这意
谁能告诉我为什么 android 应用程序中的 UI 元素与 unity 编辑器中的相比太少了? 不得不提一下,当我在 pc 上的编辑器中启动游戏时看起来还不错。 请查看屏幕上的差异。也许有一些设置I
我正在开发一款增强现实应用,可用于 Google 的 Project Tango 平板电脑和普通安卓设备。普通设备上的 AR 由 Vuforia 提供支持,因此其库可用于应用程序的开发。 虽然 Tan
我正在关注 Vuforia 并且我已经运行了示例,但是如果我想启动我们自己的应用程序怎么办,那么任何人都可以知道一些引用资料或书籍或任何可以帮助我首次启动该应用程序的东西。 最佳答案 不完全是 Vuf
我有一个由 Unity3D 生成的 xCode 项目(其中包括一个动画),我已经集成了用于显示动画(增强现实)的 vuforia SDK 我现在遇到的问题是在我的应用程序的相机屏幕和仪表板之间添加导航
我是一名优秀的程序员,十分优秀!