Topic locked

3d Object top view always facing the camera whatever the angle and on chance scene the lights will be turned off

May 11, 2015 - 10:26pm #1

Vuforia SDK Version: 4 -
Description with steps to reproduce:

Hello, 

Good Day. Need help. The 3d Object top view will always face the camera whatever the angle of the camera on the imagetracker when the object is touched or the user will try to rotate the object.

Another thing, the lights being setup be turned off whenever a scene is changed and goes back to the previous scene but with lights but this time the lights are turned off.

Please help. Below is the code for the object rotation.

var speed : int;
var lerpSpeed : float;
private var xDeg : float;
private var yDeg : float;
private var fromRotation : Quaternion;
private var toRotation : Quaternion;
 
function Update () {
 
        if(Input.GetMouseButton(0)) {
 
                xDeg -= Input.GetAxis("Mouse X") * speed;
                fromRotation = transform.rotation;
                toRotation = Quaternion.Euler(yDeg,xDeg,0);
                transform.rotation = Quaternion.Lerp(fromRotation,toRotation,Time.deltaTime * lerpSpeed);
        }
}

 

Thanks,

-
Development OS (Mac OS X, Windows, Linux): Mac OS X -
Mobile OS and Version: 7.1 -
Mobile Device Manufacturer and Model name: Apple -
Do the Vuforia Sample Applications show the same behavior?:

3d Object top view always facing the camera whatever the angle a

May 19, 2015 - 11:05pm #8

Thank you very much! It finally work!

 

I'm going to look for another script on object rotation. Thank you very much AlessandroB! :)

3d Object top view always facing the camera whatever the angle a

May 17, 2015 - 11:43pm #7

From the screenshots (which I removed because they were showing your license key in the ARCamera panel .... I remind you that this is a public forum), it appears that the Image target in your scene is attached under the Background Plane (child of Camera);  not sure why you chose this approach, but this may create some of the issues you are seeing; you should probably consider attaching the Image target at root-level.

Also, in your scene setup you have a second camera, so, maybe check if there is any conflict between the two (for example, the Camera "Depth" controls the rendering order of the cameras in the Unity scene)

3d Object top view always facing the camera whatever the angle a

May 17, 2015 - 6:59pm #6

Hello Good Sir.

Thank you very much for your prompt reply. I already checked the ARCamera and yes there is a child "BackgroundPlane" as you can also see in the screenshot. But then I tested it, it is still the same. I also did a redo of the ARCamera setup and drag it again from the Qualcomm Augmented Reality Prefabs folder and again to no avail, it is still the same as you can see in the screenshot. Also, that green object in the screenshot is not just staying there static. The 3d object is also blinking fast.

What else should I do?

Thank you very much Good Sir. :)

3d Object top view always facing the camera whatever the angle a

May 15, 2015 - 1:39am #5

In Vuforia 4, there is a World Center Mode option called "FIRST_TARGET";  this is the same as "AUTO" in older version of Vuforia.

Also, in Vuforia 4, the ARCamera includes a child "Camera" object and the Camera has a child "BackgroundPlane" object:

- ARCamera

    - Camera

        - BackgroundPlane

Check if that's the case in your setup, otherwise you may need to delete your ARCamera and drag it again from the Qualcomm Augmented Reality Prefabs folder.

 

 

3d Object top view always facing the camera whatever the angle a

May 14, 2015 - 10:18pm #4

Please help. I think there is something wront in my setting on the ARCamera that is why when the gesture object is triggered the object's top view will face on the camera. 

Thanks. 

3d Object top view always facing the camera whatever the angle a

May 12, 2015 - 7:42pm #3

Okay. Here's the update. 

I've used this script on Vuforia 3 so I checked again all the settings because it works fine on Vuforia 3. I found out that there is a difference in the ARCamera in Vuforia 3 and 4. On the Vuforia 3 the "World Center Mode" have an "auto" option. But in Vuforia 4, there is none. And all 3 option on vuforia 4 have problems. When I use SPECIFIC_TARGET: then choose ImageTarget on the world center, the object is how it looks like on the screenshot and the walls is blinking with different colors. Same goes with the other option except if the World Center Mode setting is "Camera". But then again, the problem on camera option is the object top view will face on the camera. On the previous vuforia version, there is no problem with the rotation and world center mode.

Is there a way we can put the "auto" option back?

Also on the previous vuforia version, the light works fine when changing scenes. 

Thanks,

 

 

3d Object top view always facing the camera whatever the angle a

May 12, 2015 - 4:59am #2

Hi,

what you describe sounds like a general Unity programming question (how to setup a Unity object transform so that the obejct always show the same face), not a bug or issue directly related to Vuforia.

Note that this can be done by adding a custom script to the desired TrackableBehaviour game object and process its Transform component.

 

Topic locked