Log in or register to post comments

doing virtuel realty with vuforia ?!

October 30, 2012 - 8:41pm #1

Hello Guys ,

I have a project . And in this project I have to build a  Agumented realty and virtuel realty together , my question is can i do VR with Vufrial or i have to use diffrent library ?! , if the anser is yes , any helpfull link will be very great .and i will be thanksfull.

note : i'm bulding my project in Unity

 

Thanks alot in advance .

doing virtuel realty with vuforia ?!

October 31, 2012 - 9:40am #5

yes, but what exactly do you mean by Virtual Reality application?

N

doing virtuel realty with vuforia ?!

October 31, 2012 - 8:16am #4

 

"can i do VR?" --> i meant , is Unity Vuforia SDK able to build Virtual reality  application ?

doing virtuel realty with vuforia ?!

October 31, 2012 - 7:14am #3

Hi Nalin

I did run the sample code , also did some scrpting in unity . The main problem i'm facing is that i want the ARcamera to be switch off after the frammarker is been triger , and that i'm not able to do . This is my full code .

 

this is my code .

 

var Ship     :GameObject;
var Cylin     :GameObject;
var ray     : Ray ;
var hit        :RaycastHit;
var cam     :Camera  ;
var main    :Camera;
var offset  = 1 ;//the minimam distance btween fingers
var ratio = 10;
var stringToEdit : String = "Hello Word";

function FixedUpdate () {

// at least to finger are touching the screen .
if (Input.touchCount > 1 )
        {
            //initialization and Declatation of touch object
            var fing1 : Touch = Input.touches[0];
            var fing2 = Input.touches[1];
            // ray will hold the data of object been hit by fing1 .
            ray = cam.ScreenPointToRay(fing1.position);
            //getting the Distance btween the two finger in the current fram
              var curDist = fing1.position - fing2.position;
              //getting the Distance btween the two finger in the privise fram
            var prevDist = (fing1.position - fing1.deltaPosition) - (fing2.position - fing2.deltaPosition);
              //check if the object is visibal on the screen , if it shutdown the ARCamera
              if (Ship.renderer.enabled == true )
                      {
                      stringToEdit+=stringToEdit +"i'm in";
                      cam.active = false;
                      main.active =true;
                      main.enabled=true;
                     
                     
                      }
             
            if (fing1.phase == TouchPhase.Moved && Physics.Raycast(ray,hit))
                    {
                             
                        var delta =   (curDist.magnitude - prevDist.magnitude) ;
                       
                        if ( Mathf.Abs(delta) > offset)
                        {
                                   
                                     stringToEdit  = "{ "+ Mathf.Abs(delta).ToString() + " } -- {" + offset.ToString()+"}";
                           
                           
                           
                            if ( curDist.magnitude   > prevDist.magnitude )
                            {
                           
                            Ship.transform.localScale += Vector3(0.1,0.1,0.1);
                           
                            }
                            else if ( curDist.magnitude   < prevDist.magnitude)
                            {
                           
                            Ship.transform.localScale -= Vector3(0.1,0.1,0.1);
                            //Ship.renderer.material.color = Color.red ;
                            }
                        } else {
                                    if (Ship.renderer.material.color == Color.red )
                                    {
                                    Ship.renderer.material.color = Color.black;
                                   
                                    }else {
                                    Ship.renderer.material.color = Color.red;
                                   
                                    }
                                }
                    }
       
       
       
       
        }

}
//to display value in the screen to help me debug
        function OnGUI ()  {
                                // Make a multiline text area that modifies stringToEdit.
                                GUI.TextArea (Rect (10, 10, 200, 100), stringToEdit, 200);
                            }
                           

 

doing virtuel realty with vuforia ?!

October 31, 2012 - 5:22am #2

Why don't you download the Unity Vuforia SDK and play with the samples?

This way you will get some experience and understanding and hopefully be in a better position to answer your own question :)

Finally, what exactly do you mean by "can i do VR?"

N

Log in or register to post comments