Log in or register to post comments

Random transformation of GO when VB Behaviour script is applied ?

December 26, 2012 - 1:24am #1

I was working with the sample app provided for Virtual Button example. I added one new sphere GameObejct as a chilld of ImageTargetWood and add VB Behaviour script to it. I positioned the sphere exactly of my dimension to fit the particular place in the target, but after applying the VB Behavoiur script, the scaling change the values automatically. How can i avoid that ??

And instead of showing the white coloured rectangle alone can i show a rich Interactive button virtually to the user ?? Please clarify.

Thank you.

Thank you, NalinS. That would

January 4, 2013 - 5:59pm #8

Thank you, NalinS.

That would be good as of now for me.

Sorry for the delay in

January 4, 2013 - 10:42am #7

Sorry for the delay in replying.

One thing you could try is to implement a custom shader for the virtual buttons that is circular i.e. with a png texture containing an Alpha channel so you just get a circle.  If this can work, the only real limitation would be that the detection would still be confined to the Rectangle area.

HTH

N

Need a spherical virtual button instead of rectangle one

December 27, 2012 - 8:59pm #6

Hi Davidbeard,

I need one spherical shape virtual button other than the rectange shaped given with the sample, how can i achieve this ??

And thanks for the code on creating virtual button on runtime, that was so useful.

Can you send me your project?

December 27, 2012 - 8:03am #5

Can you send me your project? - I'm not clear on what you're seeing. Also take a look at the VirtualButtonsMenu script in the Virtual Buttons sample. This demonstrates how to create VBs and configure VBs at runtime.

e.g.

                    // Deactivate the dataset before creating the virtual button.
                    ImageTracker imageTracker = (ImageTracker)
                                                TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);
                    DataSet dataSet = imageTracker.GetActiveDataSets().First();
                    imageTracker.DeactivateDataSet(dataSet);

                    // Create the virtual button.
                    VirtualButtonBehaviour vbb = mImageTargetWood.CreateVirtualButton(name,
                                                                                      new Vector2(position.x, position.z),
                                                                                      new Vector2(scale.x, scale.z));

                    if (vbb != null)
                    {
                        // Register the button with the event handler on the Wood target.
                        vbb.RegisterEventHandler(mImageTargetWood.GetComponent<VirtualButtonEventHandler>());

                        // Add a mesh to outline the button.
                        CreateVBMesh(vbb);
                    }

 

*mImageTargetWood is the Image Target Behaviour used in the sample

Update on scaling ?

December 26, 2012 - 5:02pm #4

Any updates regarding why the value of scaling in Y getting changed ?

Am currently working on 2.0

December 26, 2012 - 2:07am #3

Am currently working on 2.0 only, i can simple add a sphere and add VB Behaviour script component to it then the scaling on Y changes from anything to 1.

Oh Thank you, i will try adding interactive buttons and check them.

VB Scaling / Model

December 26, 2012 - 1:55am #2

"but after applying the VB Behaviour script, the scaling change the values automatically"

Not sure about this so will need to investigate.  Did this happen in 2.0 and 1.5.9 SDK?

"can i show a rich Interactive button virtually to the user"

There is no reason you cannot display any button with a cube or even a plane with a video playing on it.  All you would need to do is to make it a child of the ImageTarget and then check when the user touches on the object with a simple Raycast.

HTH

N

Log in or register to post comments