Hello Daniel,
I have been trying to implement the same thing in my application, that is displaying a 3D model at the center of the screen in the AR scene and be able to follow it when the user moves with the device, or turn the device around him/her. Just a 3D object that stays at the center of the screen at all times. A 3D arrow for my example.
Is it possible to do that with the MarkerTrackingPlugin but markerless as you said above?
Also, is there any further documentation / code sample regarding this in your new release?
If you could divulge some more information about the implementation of such an algorithm, I would be more than glad.
F.Y.I: My Android application that I am building is for indoor navigation via AR and the concept is to have a 3D arrow at the center of the screen that the user can follow and navigate efficiently towards a PoI.
Hi Nikolaos,
it seems to me you need the exact same thing the previous poster needed. You should be able to use the exact piece of code I posted, replacing the hard-coded projection matrix of course. Taking the MarkerTrackingPlugin as a starting point is what I would recommend you do. Your use-case is just a simplification thereof.
- Daniel
hello,
Thanks for reply..
We want 3D model/object which can move with camera.we don't want object at particular location.
In instant tracking that object gets invisible if we move camera.
Hello Daniel,
Thank you for your answer.
Regarding the registration of the MarkerTrackingPlugin. This is a c++ plugin. So I have to register it via the PluginManager and then link the .cpp, .h files and the required libraries with Android studio's Gradle, defining them in a CMakeLists.txt file or in an Android.mk file?
What I want to ask is, for the Plugin Registration do I have to follow the instructions of: https://www.wikitude.com/documentation/latest/android/pluginsapi.html
or
https://www.wikitude.com/external/doc/documentation/latest/androidnative/pluginsapi.html
I am a little bit confused. I use the JS API of course, but since a c++ plugin is a native addition to the application do I have to look for implementations to the Native API as well?
Hi,
you don't need to use the native SDK, the JavaScript SDK has a plugin API of its own, one I believe we've talked about this in another thread. You need to create a C++ plugin class (a class that derives from sdk::Plugin and override its methods), compile that to a native library and the use the plugins API to register it with the ArchitectView. Our sample application of the JavaScript SDK does include several plugins that should serve as a reference. The relevant documentation pages you seem to already have found.
- Daniel
Hello again Daniel,
Ok, you have made things clearer for me now. One more question though. In the official documentation of the Plugins API for JavaScript the following is specified:
All files needed are located under the folder PluginBuilder in the Wikitude SDK Android package
There is also a reference to an Android.mk file (makefile) located in this PluginBuilder folder, specifically in the path: SDKPackageRoot/PluginBuilder/jni as the documentation later specifies. In the Wikitude Android SDK Package 8.9.0 there is not such a folder, neither an Android.mk file exists somewhere. Could you please redirect me to a version that contains this folder so I can download it? Or even send me this folder yourself if possible?
Thank you very much and I appreciate your help so far.
Nick
Hello,
Your question is right.
We have used Augment reality everywhere in app using Wikitude. But for one Use case We want to show that 3d model(wt3) as continuous view above wikitude camera.We are stuck on this last case.
Hello,
what you want to do is possible with the JavaScript SDK, but you will need to use a (very simple) plugin and an AR.Positionable with it. The AR.Positionable object allows to specify the position of any AR.Drawable (e.g. AR.Model) and thus bypassing the tracking of the SDK itself. The intention of this feature is to allow users to implement their own tracking algorithms, but a fixed position can, obviously, be supplied as well.
We do have an extensive sample for this use case. You can find the corresponding documentation page here.
In the MarkerTrackingSample class, you would simply remove most of the code and add the following lines in the updatePositionables function:
wikitude::sdk::Matrix4 identity; wikitude::sdk::Matrix4 trans; trans[0] = 0.00962843f; trans[1] = -0.765947f; trans[2] = -0.288562f; trans[3] = 0.0f; trans[4] = 1.33069f; trans[5] = -0.00890594f; trans[6] = 0.0619125f; trans[7] = 0.0f; trans[8] = -0.0833194f; trans[9] = -0.23075f; trans[10] = 0.955458f; trans[11] = 0.0f; trans[12] = 0.0396224f; trans[13] = 0.0450674f; trans[14] = -0.396882f; trans[15] = 1.0f; it->second->setWorldMatrix(identity.get()); it->second->setViewMatrix(trans.get()); it->second->setProjectionMatrix(_projectionMatrix.get());
If you use the car.wt3 model, it will float nicely in the middle of the screen using this transformation. For your use case and model the values of this transformation matrix will obviously be different.
Make sure to call enteredFieldOfVision once. That will set the positionable into the "currently being tracked" state. This causes it to be displayed until you call on exitedFieldOfVision.
it->second->enteredFieldOfVision();
You will have to handle handle some things yourself (device orientation change, providing a projection matrix, ...), but all these steps are demonstrated in the MarkerTracking sample and accompanying documentation.
- Daniel
swapnil pol
Hello,
1)I want to place the 3d model [wt3] or any 3d model in android on plane surface i don't want image tracking and location for 3d model with your sdk . we want to buy your sdk but this is our business requirement. we want to add the 3d model and we can drag,drop,scale.
or can we use other android native 3d engine with opengl for achieving this.
2)and second thing is create problem with google panoramaView.
Thanks and Regards
Swapnil pol.