Search Unity

Unified Coordinate System for String and QCAR

Discussion in 'Scripting' started by Elecman, Oct 15, 2011.

  1. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Vectrosity only draws lines and dots so you still have the tracking filter and marker stitching. The only feature you won't have is the geometry creation feature, or at least it will be limited.
     
  2. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    I download Vectrosity 2.0.
    Have this itens.

    TankZone_Unity3.unitypackage
    VectrosityCore.unitypackage
    VectrosityDemos_Unity3.unitypackage
    Vectrosity.dll

    What do I need to do in order to make Vectrosity work?
     
  3. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Not sure about version 2.0, but with 2.1 it is:

    3. Import VectrositySource.unitypackage and VectrosityDemos.unitypackage

    Try to upgrade to version 2.1
     
  4. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    OK, i change

    #define VECTROSITY
    to
    //#define VECTROSITY

    now this errors appears.

    how can i fix that?
     
  5. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    This files are missing too.
     
  6. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    From the manual:

    Unified Coordinate System (UCS) requires a very specific installation procedure before you can build the source. Please follow the steps in "Vuforia Installation" or "String installation" exactly.

    Also from the manual:

    Vuforia installation (IOS and Android)
    If you use Vuforia as the AR engine, start with empty project and follow the steps below in this exact order.
    1. Import vuforia-unity-android-ios-2-0-30.unitypackage or higher (IOS or Android)
    2. Import UniFileBrowser.unitypackage (optional)
    3. Import VectrositySource.unitypackage and VectrosityDemos.unitypackage (optional but recommended)
    4. Import ObjReader.unitypackage (optional)
    5. Import UnifiedCoordinateSystem.unitypackage

    More from the manual:

    7. If you don't want to use ObjReader, then change
    #define OBJREADER
    to
    //#define OBJREADER
    in these files:
    MarkerRecorder.cs
    FileIO.cs

    8. If you don't want to use UniFileBrowser, then change
    #define UNIFILEBROWSER
    to
    //#define UNIFILEBROWSER
    in MarkerRecorder.cs
    Then remove the missing MonoBehaviour from every Unity scene in Hierarchy-> Main Camera -> Inspector

    Additionally:
    The scene in your screenshot with the missing files is not a UCS scene. It seems that your Vuforia installation is broken. Please start from scratch and follow the instructions in the manual exactly.
     
    Last edited: Feb 13, 2013
  7. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    could you specified me where can i download the files (links)

    2. Import UniFileBrowser.unitypackage (optional)
    3. Import VectrositySource.unitypackage and VectrosityDemos.unitypackage (optional but recommended)
    4. Import ObjReader.unitypackage (optional)
     
  8. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    From the manual:

    Prerequisites -Game engine: Unity 4.0 Basic or later. This can be downloaded for free at unity3d.com
    -Line drawing: Vectrosity. This is optional but highly recommended. It can be purchased at starscenesoftware.com
    -File browser: UniFileBrowser. This is optional and can be purchased at starscenesoftware.com
    -Obj file reader: ObjReader. This is optional and can be purchased at starscenesoftware.com
    -AR tracking engine: String, Vuforia, or PointCloud. String can be purchased at poweredbystring.com. Vuforia can be downloaded for free at ar.qualcomm.at/qdevnet/sdk. Pointcloud can be downloaded for free at 13thlab.com.
    Note: UniFileBrowser and ObjReader are only needed if you want to use the obj feature of UCS.
     
  9. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    You said that these 3 package are Optional.

    2. Import UniFileBrowser.unitypackage (optional)
    3. Import VectrositySource.unitypackage and VectrosityDemos.unitypackage (optional but recommended)
    4. Import ObjReader.unitypackage (optional)

    but if i did not import these 3 package, then, it will going to be errors? thats right?
     
    Last edited: Feb 14, 2013
  10. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    All these packages are optional.

    Vectrosity is highly recommended.

    In order not to get errors, you need to make some changes to the source code.
     
  11. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    These program can i download it for free, or must be paid, in order to work with UCS.

    2. Import UniFileBrowser.unitypackage (optional)
    3. Import VectrositySource.unitypackage and VectrosityDemos.unitypackage (optional but recommended)
    4. Import ObjReader.unitypackage (optional)
    5. Import UnifiedCoordinateSystem.unitypackage
     
  12. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    2 paid (no need)
    3 paid (need)
    4 paid (no need)
    5 free
     
  13. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    i gonna buy this

    3. Import VectrositySource.unitypackage and VectrosityDemos.unitypackage (optional but recommended)


    so you can show me the link os there other that are free. I can't find it.

    2. Import UniFileBrowser.unitypackage (optional)
    4. Import ObjReader.unitypackage (optional)
    5. Import UnifiedCoordinateSystem.unitypackage
     
  14. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
  15. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    Is this still compatible with Unity 3.5.x? If so I'm going to take a look at it tomorrow as it seems very interesting (already working with Vuforia, and I also have vectrosity)
     
  16. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Dover8 , Do you have Vectrosity 2.0 or 2.1 ?
     
  17. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    if I use vuforia-unity-android-ios-2-0-30.unitypackage and UnifiedCoordinateSystem.unitypackage 1.0.

    Without
    Import UniFileBrowser.unitypackage (optional)
    Import VectrositySource.unitypackage and VectrosityDemos.unitypackage
    Import ObjReader.unitypackage (optional)

    It will WORK? or there gonna be errors?
     
  18. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    2.1
     
  19. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    @Dover8
    It is compatible with 3.5 only if you make some changes to the source code. You will have to change SetActive calls to SetActiveRecursively with the correct logic (these functions do not behave exactly the same).

    @gringofxs
    This will only work if you make some changes to the source code as explained in the manual and in the replies I gave you earlier.
    I see that you have trouble wrapping your head around installing UCS. If you can't figure out how to install UCS using the manual and my help then you will have trouble actually using UCS for sure. UCS is not designed as a shoot-and-forget package and is not necessarily intuitive or easy to use if you are looking for a works-out-of-the-box solution.
     
  20. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    I just have Unity 4 and UCS, i need to be sure that it will work, to not in vain to buy the Vecttrosity 2.1. Them i will not wonna work, that is my doubt.

    Ive download your https://play.google.com/store/apps/details?id=org.monosock.ucs for android. works perfect.
    I need the UCS work exactly as you UCS.apk for android. inside Unity 4

    So i thnks that i will need to buy these 3 files:

    Import UniFileBrowser.unitypackage (optional)
    Import VectrositySource.unitypackage and VectrosityDemos.unitypackage
    Import ObjReader.unitypackage (optional)

    Thats my doubt. Cause i pretent to export the .apk from Unity as did with your.

    I think that is the problem that i having with the errors in Unity.
     
  21. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    can i use image target without the Black Border? just the image target.
     
  22. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    You don't need UniFileBrowser
    You don't need ObjectReader
    You do need Vectrosity.

    You will get some errors but these are easily fixed. Please follow the manual to fix the errors. You have to disable some defines in a couple of scripts, that's all. Do you know how to do programming?

    Yes, you can use image targets without the black border. Please follow the Vuforia online target management system to generate image targets.
     
    Last edited: Feb 21, 2013
  23. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Ok, i read the manual, now is working,
     
  24. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Ok, now when i open the Vuforia-4-ImageTargets, i canot see the imaget target.

    How can I put 3 image target? the process

    I already have the 3 generatet image targets.
     
  25. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Great :)

    Vuforia-4-ImageTargets is not a UCS scene. The UCS scenes are:
    VuforiaFrameMarkersManual
    VuforiaFrameMarkersRuntime
    VuforiaImageTargetsRuntime

    The manual also contains the process of changing image targets and how to use UCS in general.
     
    Last edited: Feb 22, 2013
  26. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Ok, i open the (VuforiaImageTargetsRuntime) them i have
    ARCameraUCS
    Cube
    FPS
    MergedScenes
    ObjLoad
    redDot
    Sphere
    VidTexDeform
    VidTexPatch

    If i want to add 3 image target from the online Target Management System Vuforia.
    I import it to the (VuforiaImageTargetsRuntime) ?

    How i can put the 3 image target, in 3 obj.planes to now whats append, as the Vuforia-4-ImageTargets.

    Please have a little patiente with me. ok
     
    Last edited: Feb 22, 2013
  27. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Please provide some detailed information about what exactly you don't understand from the chapter "Changing Markers".

    Also, UCS does not work the same way as with the Vuforia example scenes. You will not see any markers in the Unity Editor and you can not attach content to markers the same way as with the Vuforia example scenes. See the chapter "Scene Setup" for details.

    Additionally, I just noticed an error in the manual at the Changing Markers chapter. Step 4 should read:
    So Vuforia.cs instead of MarkerRecorder.cs. Will fix this in the next release.

    By the way, a new release won't happen until Unity releases the new GUI system.
     
    Last edited: Feb 23, 2013
  28. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Ok, as u did in your video, I have 4 image marker, then i have a 3d ball and I want the 3d ball goes through the 4 image marker even if 3 of them is out of view as you did with you car. I already have the 3D ball touch control in unity.

    I need to now how to do that, if (VuforiaImageTargetsRuntime) is the rigth project to work with the image target.

    I need to use the filter of UCS for less flicker the 3d Obj and the ability of a bigger space area even if a image marker is out of view.

    It is possible to drive me through this.


    I understand the video that u made, showing the 3d car and how to setup the UCS to recognize a bigger space area with more image target.

    I need to now how to import 4 image target that i already have from the online Target Management System Vuforia and implement that, to your UCS VuforiaImageTargetsRuntime.
     
    Last edited: Feb 23, 2013
  29. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    -VuforiaImageTargetsRuntime is the right scene

    -How to do what you want is explained in the chapter "Scene Setup".

    -The pose filter will increase flicker, not reduce it. It will enhance the tracking accuracy though.
     
  30. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    The is no relation between (VuforiaImageTargetsRuntime) and the (Vuforia-4-ImageTargets)

    cause i pretend to use 3 image target without the black square border, for a bigger play field area.

    In this video (http://www.youtube.com/watch?v=W6Tuvlm9Oqs) you said that the jittering is reduced with UCS, using a low pass filter to the rotation, right?

    jittering you mean flicker right?
     
  31. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Correct.

    The pose filter has a low pass filter as well, indeed. This will reduce jittering. Jitters are rapid movements. Flickering is rapid rapid alternation between the marker being tracked and lost, causing the 3d content to appear and disappear in rapid succession. Unfortunately the pose filter will reduce jittering but increase flickering. Flickering is only present with low light conditions and poor marker and or camera quality.
     
  32. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Can i email you?
     
  33. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Sure. My email is in the manual, at the License chapter.
     
  34. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240



    I now how to do that with vuforia image target, but i need to have more image target to get a bigger fieldsize. As you did with the car.

    the 3D airplne model I already have it.
     
    Last edited: Feb 24, 2013
  35. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    What you want to do is perfectly possible using UCS.

    Maybe I didn't get what you meant by "Vuforia-4-ImageTargets" and "Target.UnityPackage". Are these dataset files you downloaded from the Vuforia Online Target Manager?

    In order to help you to get your project up and running, I shall copy and paste all applicable info from the manual. However, I kindly ask you to read all of the manual anyway.

    From the manual:
    Note: don't forget that "NewName" is just an example name. You have to find out what the name of your dataset is by navigating to the \Assets\StreamingAssets\QCAR folder and looking at the xml or dat file name of the UnityPackage you imported from the Vuforia Online Target Manager.

    Also note: I see that one of the markers you are using is a default Vuforia marker (stones image). Presumably this default marker is not present in the custom marker dataset you created. It is not possible to combine multiple datasets. All image targets must be present in the same dataset.

    More from the manual:
    Please refer to the Unity documentation on how to export an application to Android.

    I know that it is easier if I give you personal guidance with setting up your project, but I can't do that all the time. That is why I made a manual. If something isn't clear in the manual, information is missing, or otherwise not being of much use, please let me know the details of where you are stuck and I will be glad to help.

    However, if you didn't read the manual at all then you will find people will be less helpful. This is true for everything.
     
    Last edited: Feb 25, 2013
  36. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    when I refer Vuforia-4-Image Targets.scene, is because the project is already done, so and import the target image from Vuforia onlie target manager, then import it in the Vuforia-4-Image Targets.scene in Unity, and put on the 3D object over target image plane and export it as .APK

    I do not understand is how I put more imagetarget to get a larger gamefield as you did, I do that inside your project (UnifiedCoordinateSystem.unitypackage) VuforiaImageTargetsRuntime in UNITY or first I need to export your UnifiedCoordinateSystem.unitypackage (VuforiaImageTargetsRuntime) to an .APK and select the image Target rigth on the Cellphone aplication .APK exported from Unity.

    Do you undestand what im saying?

    Lets say that I have a 3D airplane, that I export from Maya, the airplane is fliyng in circle that I already key frame it in Maya.
    Then I import the 3D airplane inside your UnifiedCoordinateSystem.unitypackage inside UNITY, or first, I export your UnifiedCoordinateSystem.unitypackage (VuforiaImageTargetsRuntime) from UNITY as .APK and them import the 3D airplane rigth from the running .APK in the cellphone.

    That what i dont get it.
     
  37. rockard

    rockard

    Joined:
    Feb 25, 2013
    Posts:
    2
    I have followed the "Vuforia installation" but only get a black background when pressing play. I use "VuforiaImageTargetsRuntime".

    In step 8, I feel the instructions is a bit vague . It says you should "change" the update function so it looks like
    "
    void Update()
    {
    Camera.main.transform.position = Vector3.zero;
    Camera.main.transform.rotation = Quaternion.identity;
    if (!mIsInitialized)
    "


    So, am I supposed to just add the new code, and not replace anything?

    My code then looks like this, including some code that comes after:


    "
    void Update()
    {
    Camera.main.transform.position = Vector3.zero;
    Camera.main.transform.rotation = Quaternion.identity;

    if (!mIsInitialized)
    if (QCARManager.Instance.Initialized)
    {
    // Get the current orientation of the surface:
    ScreenOrientation surfaceOrientation = (ScreenOrientation)QCARWrapper.Instance.GetSurfaceOrientation();
    ......

    "


    Is this correct? The videobackground doesnt work now..
     
  38. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    I tried importing the package to a new project (with Vuforia already imported) and I get a Fatal Error: "type == kMetaAssetType pathName.find("library/metadata") != 0"

    Any suggestions as to why? Running Unity Pro 3.5.2
     
  39. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    @gringofxs
    Forget about Vuforia-4-Image Targets.scene as you are not going to use that. If you have content created for that scene, import it only for the UCS scene. Do not export Vuforia-4-Image Targets.scene as an APK. Do not use that scene. Only use a UCS scene.

    First setup your project in the VuforiaImageTargetsRuntime scene in the Unity Editor according to the "Scene Setup" chapter. Then upload your project to a mobile device. Then record, save, and run the scene at the mobile device. Like this:

    From the manual:
    Recording and saving excerpt from the manual:
    So like this:
    Not like this:
     
  40. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    @rockard

    -Go to Hierarchy window->ARCameraUCS->Inspector->Web Cam Behaviour->Don't use for playmode = unchecked
    -Go to File->build settings->Select PC as build platform-> click Switch Platform. Due to a Vuforia bug, camera preview in play mode doesn't work when a mobile build platform is selected.
    -Does it work in a default Vuforia scene?
    -Do you have Unity Pro? Video preview only works with Pro.
    -Do you have a webcam? The VuforiaImageTargetsRuntime scene isn't showing anything in Play mode if you don't have a webcam and are not using the Vuforia webcam preview feature.

    Correct.

    That looks correct. I will update the manual to make it a bit more clear. It now reads as such:

    That fix isn't to get the video background in Play mode to work but to prevent the camera from spinning around.
     
    Last edited: Feb 25, 2013
  41. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    @Dover8

    I think that is because I made the unitypackage in Unity 4 and perhaps unitypackages are not backwards compatible with older versions. Try importing the unitypackage in a free version of Unity 4 and then just copying and pasting the files into your Unity 3.5 project.

    Or maybe try the fixes discussed here:
    http://forum.unity3d.com/threads/16...thName.find(-quot-library-metadata-quot-)-!-0

    http://answers.unity3d.com/questions/319077/downgrade-project.html

    http://forum.unity3d.com/threads/160292-version-4.0-and-3.5.6-installed-together
     
    Last edited: Feb 25, 2013
  42. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    Elecman, it is possible that you made a tutorial step by step, showing how to create inside UCS, vuforia Image Targets, Stitch markers together for use in one scene, and Load pre-made obj files, to work in order with UCS.

    Or this process is in the manual?
     
  43. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    These step by step tutorial are already in the manual.

    Applicable chapters from the manual:

    Step by step tutorial for installation:
    "Installation"

    Step by step tutorial for changing the markers with your own:
    "Changing Markers"

    Step by step tutorial for setting up your scene:
    "Scene Setup"

    Step by step tutorial for on-device usage:
    "Recording and Saving"

    I don't think you want to use the UCS feature of loading pre made obj files. That is only to be used for advanced real world geometry creation. If you have normal 3d content you want to show, make that a child of an empty game object as per the "Scene Setup" chapter.

    What you can also do is getting used to the on-device workflow first, before you start delving into changing the 3d content, using your own markers, etc. Just upload a fresh version of UCS to a mobile device and try to get the cube to show up in a large playfield. That should all work out of the box with the supplied markers. Once you can do that, change the cube with your own 3d content. Once that works, try replacing the default markers with your own. Just do it one step at a time.

    Please let me know where exactly you are stuck with the tutorials in the manual.
     
    Last edited: Feb 26, 2013
  44. rockard

    rockard

    Joined:
    Feb 25, 2013
    Posts:
    2
    Thanks Elecman for your help, but it did not solve the problem.
    Still no video in preview mode OR on Android. :(

    The Vuforia example applications are working fine. Both preview mode and mobile mode (android) works as intended.
    I'm using vuforia 2.0 and Unity 4.0.1f1.

    As you can see on the screenshot, the videobackground is showing in the editor when previewing, but not in the preview-view.
    I also get an error: Screen position out of view frustum (screen pos 378.000000, 1.000000) (Camera rect 0 0 869 282)
    UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32, Int32)



    $screenshot.jpg


    Any other suggestions?
     
  45. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    Pretty sure that error just comes from your mouse being up at the play button (and therefore not in the screen bounds) when you start Play mode.
     
  46. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    @Elecman, I follow the Manual, but when I debbug to my Android, there is no image, everything is black. What can i do?
     
  47. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    @rockard
    Dover8 is right about the view frustum warning. That warning is harmless. However, based on your screenshot I can see that something went wrong as the videoscreen (used for the preview) is not created for some reason. Can you scroll up the error list and see if there are any other warnings or errors? Also, try making a new project from scratch, following the installation steps exactly in the same order. I just did a clean installation (new project) and it worked fine. If that doesn't work, send me your whole project and I will have a look. I am sure we can fix it.

    @gringofxs
    Hm, strange. Not sure what is causing that. Does a default Vuforia example project work? Perhaps you can send me your project and I will have a look as well.
     
  48. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
  49. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    I've done all the imports as instructed in the manual (though not using UniFileBrowser or ObjReader) and loading the scene VuforiaFrameMarkersManual there is a missing script on the ARCameraUCS prefab, the one beneath MarkerRecorder and above Gui. Any suggestions as to which script is meant to be attached here? Also missing a script on the ObjLoad object.
     
    Last edited: Feb 26, 2013
  50. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    @gringofxs,
    Thanks for your project. Will have a look at it.

    @Dover8
    That missing script is from UniFileBrowser and shouldn't cause any harm.
    -Which platform are you developing on? (OSX, Win)
    Let me try to run UCS on Unity 3.5, will let you know what happens.