I am working with Unity - Professional Edition.
I have a simple scene with object tracking. The recognition works fine. But the drawable always aligns itself with the camera. How can I give the drawable a fixed rotation and make sure it stays that way?
have you created your own target? When creating a target using Wikitude Studio Editor the objects rotation is sometimes off. This is because the Studio Editor does not know where the object's front is. Unfortunately one can't change the object's alignment in Studio Editor at the time.
If you rotate the Drawable object you want to display when detecting the WTO, does it still face the camera when the object is recognized? If not try to adjust its rotation so that it will be displayed correctly.
If this does not solve your issue, could you provide some additional information and maybe some screenshots of the erroneous behavior?
With best regards,
Thank you very much for your answer.
In our project we want to display buildings in black and white. We took photos of these buildings and created object targets with wikitude studio.
As drawable we use a 3d object in the shape of the building. On top of this object is a transparent shader that shows everything behind it in black and white. If you look at the building from a front view, it works:
But if you look at it from an angle, from the side, the drawable does not lie flat on the facade of the building, but aligns itself to the camera:(To make it easier to see, I have colorized the drawable green)
How can I give the drawable a fixed rotation so that it always lies flat on the facade of the building?
Thanks a lot
now I see your problem and can also reproduce your issue. The thing is that the object tracker is expecting a 3D object to track. Since you provide a 2D image instead the tracker gets confused - that's why your Drawable is facing the camera instead of the 2D target's rotation.
If you use Image Tracking instead of Object Tracking the Drawable would keep the 2D target's rotation instead of facing the camera. But I do assume that's not the behavior you want to achieve. Instead try to add an additional target for testing purposes. Something smaller than a building that would fit on your desk so you can track it more easily (like a toy, coffee machine, ...). Once you've implemented and tested your features with the testing object just change the WTO back to the buildings and you can go outside to see if everything works as expected.
With best regards,