Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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
    You can read up on the recording process in the chapter called "Method of operation". It doesn't really make sense to do that on the Mac or PC as you cannot pan the camera around in the Editor but you can do that on Android or IOS.

    Did you get it to work on your iPad?

    Edit:
    I uploaded a new version (0.9c) which has an updated manual with some screenshots explaining the layer settings in more detail. Also I fixed that MarkerRecorder.cs bug regarding disabling ObjReader but you already have that file so no need to overwrite it. Just have a look at the manual.
     
    Last edited: Oct 21, 2012
  2. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Hi Elecman,

    I have UCS running on my ipad2 :) Now I am trying to load my little bear character called "Cog"

    My Test Scenario:
    I am trying to add a bear character to a single scene set-up. The character is driven by a 3rd person controller finger gestures.
    The bear will simply walk forward around three basic primitive capsules attached to image targets that I printed from the UCS download.

    I have two Questions.

    1. Dragging parented disabled objects to the MarkerRecorder list. If I drag the object over it will not attach, it simply returns to the Hierarchy area. If I click the small circle icon (right hand side of Inspector ) I can then attach an object... Is this correct ?

    2. Where is the best place to add my character ?

    Mick
     
    Last edited: Oct 21, 2012
  3. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    OK I will read over the manual again now. I have it operating on my iPad, I have printed out the original UCS target cards. So far so good.

    I know this will take some time to fully understand as it is all new to me. I will take notes and let you know my feelings along the way.. this can be a form of user testing for you.

    Mick
     
  4. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I think you are adding it to the wrong script location. There are basically two MarkerRecorder.cs locations. One is the script in the folder, the other one is attached to the Main Camera game object. The latter one is the script you want to drop your 3d content on. I have modified the manual now to say:

    Does that make sense?

    Please don't do anything with the small circle icon. If you changed anything regarding that, change it back to its original state.

    Actually, I didn't write the manual from the perspective of a non-programmer or someone who is not too familiar with the Unity structure. However, I will modify it to make it more clear.
     
    Last edited: Oct 21, 2012
  5. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Regarding Method Of Operation:

    I am looking through the manual now. It does make sense if I read through all the lines etc.. I feel these should be laid out in steps with tips or notes each time you want to emphasise particular actions during the set-up routine. So simple bullet points or numbers

    Step:1

    Step2: talk talk talk Note: talk talk Tip:


    regarding my 1st Question from above: yes you are right, I was selecting MarkerRecorder.cs and then dragging from the Hierarchy window to the Inspector... so I've re-set the MarkerRecorder.cs settings that I altered in the Inspector..
    Now I use Main Camera > MarkerRecorder ( drop-down menu in the Inspector )
     
    Last edited: Oct 21, 2012
  6. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Ok, I will have a look at the manual structure.

    Regarding the Unity philosophy. The scripts in the Project folders are just references to the files themselves. You don't want to change the variables on these scripts because otherwise the re-usability of the scripts will be destroyed. The way it works is: you drop a script onto a game object, and now you can change the variables.
     
    Last edited: Oct 21, 2012
  7. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Yes I have created a few small games with collision detection, animated characters etc.. I create java scripts drag them onto 3d models I have imported from Maya. I am now using PlayMaker to get around difficult scripting but hope to go back to scripting as I really should be learning C#.

    OK I have UCS rolling well now. my test scene is simply 2 target markers... one of them is being affected by the warp filter. Wow !! :)

    Next I would like to add a simple primitive with a drag gesture applied so I can move it about..

    note: the target marker is flickering slightly.

    Mick
     
    Last edited: Oct 21, 2012
  8. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Cool you have it up and running.

    The flickering is caused by low light conditions, bad quality camera (the iPad 2 camera is really bad), marker too far away, camera moving too fast, etc. You can switch off the pose filter in the UCS settings menu (in game). This will reduce flickering but will increase the amount of pose errors. Do not disable this filter during recording. Have a look at this video in which I explain the features of the pose filter:

    http://www.youtube.com/watch?v=W6Tuvlm9Oqs
     
  9. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    so my question now is: If I wish to load my own objects such as a scene with a animated character what steps would I take ?

    For Example: I import a custom package containing my bear, textures and control scripts. Where should I place them, so they will operate in a UCS environment ?

    Mick


    p.s: ok bad lighting and iPad2 camera is not good... I will try iPad three in two weeks time ( when my girlfriend arrives back from Japan )
     
  10. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    How to do this is all included in the manual. Can you have a look at it and ask me if you don't understand something? I want to avoid telling you step by step here because I can't do that for everyone and the manual should be sufficient. If the manual is unclear, I will change it. So let me know.

    Edit:
    I just added this paragraph to the "Single Scene setup" chapter to make it a bit more clear:

     
    Last edited: Oct 21, 2012
  11. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Yes I really like what you've accomplished with the Pose filter... awesome :)
    I'm sort of confused why Qualcomm has not fixed this issue. I also cheked out SLAM not long ago... looks really promising, I tried the pointCloud App ( floating space ship ) works well but it is restricted to what is directly in front of the camera during recording. UCS can move as far as you wish as long as you have at leaset 2 target markers in camera view at all time... I would like to try creating a small mini helicopter game.. so this will require markers on the roof also ? ( I think my girlfriend won't be happy when she gets home and the place is filled with strange A4 prints. ;)

    Mick
     
  12. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    I'm looking over the manual now will message you with any confusion

    one more thing.. You may want to make a note in the manual regarding setting up UCS for Vuforia : users should not copy and paste directly from the PDF into Mono Dev. as this causes " invisible " errors.

    ( I will try and sort through it myself before simply messaging you as I bet you are busy )

    Thanks so much for getting me up and rolling, I hope this will help others..

    Mick
     
  13. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    UCS will also work if you have only one marker in view. No need to have at least two in view.

    You will have to place markers anywhere where you think the camera will be pointed at.

    Try not to use A4 size markers but much bigger such as A3 and up. This means the 3d content is more stable and can be viewed from a larger distance. You need to find a copyshop which can print those though. But no need to print in color. Vuforia and String work with black and white only anyway.

    I will add the copying issue to the manual. Good point!

    Glad to help. You raised a lot of issues which I needed to fix. This will help everyone else as well.
     
  14. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Well I spent all day trying to load a single object into a scene but no luck... I read the manual over and over but there is nothing that I perceive as loading my assets.

    Single Scene Setup:

    -In the Editor, in the Hierarchy, make a separate empty game object, for example: GroundPlane. DONE
    -Put your 3d content in the GroundPlane empty game object using parenting. Disable all content, including the GroundPlane empty parent game object.
    DONE
    -Drag the parent game object (with the disabled 3d content attached to it) onto an empty slot of the Scene Objects array on MarkerRecorder.cs (in the Inspector). Yup, Done
    -You can repeat the procedure if you have more then one 3d scene you want to display separately. Buttons based on the Scene Objects array will be automatically created during runtime in the Save, Load, and Merge scenes menu.
    -Record the markers. When finished recording, choose the 3d content you want to attach to the markers. ok Done

    So now I hit Game Mode Nothing appears.... I also check to see what layer it is on I am guessing it would be the same as the camera, so default layer.

    but nothing ...
     
  15. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    OK I finally worked it out. I'm able to see a basic cube primitive that is sitting on my image target.

    It was confusing using the UCS set-up buttons on the main interface.

    ( I was trying to add my 3D Cube to a target marker that already had a "ADD Geometry" cube applied.


    1. hit record
    2. tap an image target ( the blue border then becomes highlighted )
    3. hit stop record
    4. Click Home
    5. click Save Scene select which 3D content you want to link to this scene. so I hit Cube
    After I hit stop record, I then hit Home:
    then I should have simply hit Game Mode instead of Add Geometry.

    So my issue was, I was Adding UCS Geometry to the marker but neglecting to add my 3D content.

    So now it runs ... now my little 3D Cube is flickering wildly.

    Flickering like mad.... but I'm happy I finally have it operating.

    I'll play around with QCAR.cs " HINT_IMAGE_TARGET_MILLISECONDS_PER_MULTI_FRAME = 5, "

    5 minutes later: After some slight adjustments I have now set the following properties and the update is really good clear.

    // Specify the number of Image Targets that are handled by the tracker
    // at once.
    HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS = 2,
    // Detection of Trackables is continued in the next frame if they could
    // not be found within a certain time interval.
    HINT_IMAGE_TARGET_MULTI_FRAME_ENABLED = 1,


    // Specifies the maximum time the detector should look for Trackables.
    HINT_IMAGE_TARGET_MILLISECONDS_PER_MULTI_FRAME = 5,

    Mick
     
    Last edited: Oct 21, 2012
  16. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    I am able to drag my object around in the scene.. but if I move the camera away from the primary target market I loose the object. So it is still reacting like a normal single target AR scene.

    hhhmm... ??

    10min. later. I now have three targets operating :) ( but I had to adjust Qcar.cs so it now flickers again )
     
    Last edited: Oct 22, 2012
  17. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I will try to make the manual more clear on the "Add Geometry" vs game mode logic.

    Regarding the flickering, are you sure you are using the markers in broad daylight? The camera needs a lot of light. Also, make sure there are no real shadows projected over the markers.

    Are you using frame markers or image targets? You might want to use your own image targets as mine are of low quality. It is on my to do list...

    Did you figure out why that was? I am curious.
     
  18. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Hi Elecman,

    yup, I have UCS operating quite well now :)

    Here's what I am planning to do next ( if its even possible )

    Make the Vectrostiy lines thicker when I select them.. currently it is difficult to perceive if they have been highlighted.

    JoyStick control: try to load thumb controls ( joysticks ) into the scene.
    I might try looking at the old UCS Car version.

    I want to simply move my little character about with thumb controls. I was thinking of using swipe gestures but I think I'll add that feature later.

    finally change the UCS buttons. I'll incorporate a proper menu system created in NGUI.

    p.s once I get things rolling nicely I'll create a video on youtube.

    Mick
     
    Last edited: Oct 22, 2012
  19. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Good to hear you have it working now. I will send you another version of the manual with some more screenshots later.

    To get a joystick controller do this:
    -Right click on the project window -> Import package -> Standard Assets (mobile)
    -Import all
    -Project window->Standard Assets folder -> Prefabs
    -Drag the "Single joystick" to the Hierarchy window

    I am not sure how to interface with it without doing programming though. You can have a look at UCS 0.7 for some more details.
     
  20. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    I will use JavaScript to interface. just wondering how I can see it in the UCS GUI ( I have dragged the prefab in )
     
  21. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Regarding the flickering issue: I had to turn off Pose Filtering. I really wanted to keep it on but it was just too much flicker or if the flickering stopped then UCS would only track one target.

    Mick
     
  22. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    There should not be so much flickering. On my iPad 2 I never had that much flickering. But you have to use the markers in broad daylight, close to a big window. The camera does need a lot of light. Be careful for shadows projecting over the markers though. And don't put the markers too far from the camera. If the marker is A4 size, put it maximum 2 or 3 meters away. If the 3d content you are using is very processing intensive, the flickering will increase as well as the CPU has less time to look for the marker.

    You can try to have a look at String. It's not free ($100 for the developer license) but the tracking is much much better then from Vuforia. In fact, it's so good that you don't need the pose filter all together.

    If you have a chance, post a video on youtube which shows the flickering, so I can assess the lighting conditions. Or perhaps some screenshots will do.

    Edit: I just mailed you the new manual.
     
    Last edited: Oct 22, 2012
  23. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    the settings for the Pose Filter in QCAR.cs how d o you normally have these set. e.g..


    HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS = 0,

    HINT_IMAGE_TARGET_MULTI_FRAME_ENABLED = 1,

    HINT_IMAGE_TARGET_MILLISECONDS_PER_MULTI_FRAME = 5,

    Are there certain combinations that work better ?
    Maybe I just have not found a good combo. yet..

    Mick
     
    Last edited: Oct 22, 2012
  24. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I don't really change the settings except for the one described in the manual. If you still cannot get rid of the flickering then disable the pose filter in game mode, but be sure to turn it on during recording.

    Also, try setting MODE_OPTIMIZE_SPEED on the Hierarchy window ->Main Camera ->Inspector -> QCARbehaviour script -> Camera device mode set

    Try the iPad 3 as it has a way better camera.

    Also, don't disregard the lighting tips I gave you. It is important. Low light conditions are the primary reason for bad tracking quality.

    Also keep in mind that the tracking quality of Vuforia is not that good anyway. Vuforia cheats you by displaying the AR content for a few frames (up to 6 frames in a row) even if the marker is really lost. This way the 3d content doesn't flicker, but the position is actually incorrect. You might not notice the incorrect position as this "freezing" of 3d content only happens for a fraction of a second, but this "cheat" is unacceptable when recording a UCS scene as UCS will unwittingly record incorrect marker positions, however slightly. So what I do is that I make UCS compare each frame with the previous frame and if the marker pose (position and rotation) is exactly the same as with the previous frame, I mark that particular marker as lost, this circumventing the build in Vuforia cheat. This is good for recording a UCS scene, but might not be so good when running a UCS game (game mode) due to the flickering incurred. If you want to use proper tracking software, go for String.
     
    Last edited: Oct 23, 2012
  25. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Was just reading over the manual again ( section about setting Layers )

    I notice where it states:

    -Main camera (in Hierarchy window) should have culling mask: everything except vidScreen. " but zoomScreen is also turned off in the image

    Is this supposed to be on or off ?

    P.S I'd love to use STRING but WOW !! so expensive $7000.00 for one year per App ! they gotta be nuts.
    come on SLAM... when you think we'll see more use of Slam ? will Unity integrate Slam ?
     
    Last edited: Oct 24, 2012
  26. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    zoomScreen should be turned off. Thanks for picking that up. I have amended the manual now. I will email you a new version which has an installation summary and and index as well.

    Yes, the String price is insane. I just use the developer license which is only $100 which you have to pay once. I use it for experimentation only. I won't publish an app because I will never be able to get my money back with their pricing scheme.

    SLAM is very interesting and I am eagerly waiting for that too. There is only one implementation that is fast enough for mobile devices and that is PointCloud from 13th Lab. It is not compatible with Unity yet, but they are working on it. There is no release date though.
     
  27. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Couple of Qs


    1.) Regarding Gravity: I added a rigid body to my character.. so now he drops. Do need to create a ground plane that will stop him falling if so.... is there a way to make it transparent but still show shadows ?

    2.) Sometimes I get a 1 inch blue border around the App when I first run it on the iPad.. If I close the app and re-start it .. it normally rectifies the issue .. What is that ?

    3.) Parenting Deactivating: Is this for all objects in my scene or just objects that are to be attached to a targetMarker so when I move the marker, the object moves with it.. ie. objects in Nintendo WAAR system can be positioned and then the character runs around or over them.


    Mick
     
    Last edited: Oct 24, 2012
  28. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Usually this is because the app throws a "NullReferencEexception" every frame. Either debug your code or load the original source file, like you did.

    Yes

    This is automatically done by UCS if you add geometry.
    Load or record and then save a scene -> Click "Add geometry" -> Select 3 dots (marker corners) which are on the physical plane you want to use-> Click "Add Plane" ->Bring the plane into position and set the size. Look at the manual on how to do this. -> Click "Save" -> Click "Home" -> Click "Game Mode".
    Now you have a plane which prevents your content from falling into a bottomless pit. The plane will receive shadows but the plane itself is invisible. It will also (partly) occlude 3d content if it is behind it. So basically it behaves like a real world object would. Give it a try. It is pretty cool.

    Not sure about that one... It could be a bug but if you cannot faithfully reproduce it, I cannot fix it.
     
  29. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Thanks for the reply ElecMan,

    Character Controller Gravity Issue:
    If I load my character with a 3rd person controller add a geometry plane. The character will only sit on the plane when gravity = 0 otherwise it falls straight through every time. Turn gravity off and all is fine.

    any idea ?

    Mick
     
    Last edited: Oct 24, 2012
  30. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Ok, I have the same problem. Let me fix it...
     
  31. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    I know I'm sending lots of messages at the moment.. but if I find an issue it can only help, right .. as trivial as they may be.

    Mick
     
  32. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    If you place your character controller a bit higher above the geometry to start with, it won't fall down anymore. It is an issue with Unity, not with UCS. Try this logic out with a normal non-UCS project and you will see how it works.

    On a side note, If you have any normal physics objects (no character controller, just an object with a rigidbody and gravity enabled) then you may need to switch on "Interpolate" at the rigidbody component.
     
  33. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    OK I have it loading in iPad.. BUT

    Here's the issue in a nutshell " game mode works fine once or twice and then the object falls " making it impossible to load the scene again.

    on the ipad: while the scene is loaded

    hit HOME > Game Mode > Home > Game Mode > Home > Game Mode it will fall away after two or three repetitions.

    to rectify this, I simply close the app ( with the "close App" button ) then re-open... Load Scene (choose my scene ) hit Game Mode it works again fine.

    You're probably already aware of this....


    Mick
     
    Last edited: Oct 24, 2012
  34. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I didn't see this problem before.

    I couldn't reproduce this on the PC. I will try later on my Android. Try if you have the same problem with a normal object (not a character controller) and a rigid body attached. Then play around with the collision settings.

    Pressing the home button while in game mode does not reset the scene state to the same state as when you are loading it. It merely disables all game objects temporarily. It is not up to UCS to reset the game state as that is highly app-specific. But in any case, the object shouldn't be falling through...

    Can you send me your sample project?
     
  35. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    I've got the thumb sticks operating.. The bear moves with the sticks.

    Issue: Object scale in relation to camera joystick movement:
    The control pad movement is amplified if I scale the bear very small so it fits properly in camera frame.

    The Bear is too small so it simply zips of the screen. If I scale the Bear up to the correct size, then the camera sees an object that's huge and too close to camera ( but the move control works great at this size as this is the correct character scale )

    I'm guessing that when I imported the Bear Object from Maya into Unity, the scaling was incorrect and I scaled the bear down to fit the UCS scene.

    Elecman: Try dropping a "Player Relative Control"(from standard Mobile assets) into the scene let me know how large the capsule looks ?

    note: Last night I went to the London Unity Users Group ( LUUG )

    I met several AR game develops. I told them of the UCS system.. so hope they will try your system shortly.

    Mick
     
    Last edited: Oct 26, 2012
  36. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Ok, I will have a play with the Player Relative Control in a few days when I have some more time.

    But before that, can you setup your scene in a non-UCS project? Some problems you are encountering have nothing to do with UCS like your character controller falling through a plane when it is first spawned. This will happen in any project if you don't spawn it at the correct height, not just with UCS.

    I suspect that the object scaling, speed issue has nothing to do with UCS either. That is just a result of general logic.

    Remember that UCS does no magic. It simply transforms your scene so it is placed on top of a few markers. If your project has problems in a normal setup, it won't work in UCS either.

    About the UCS scale:
    UCS regards one marker unit (in Vuforia) as one meter. Unity also regards one unit as one meter. So if your marker is 30 cm wide in the real world, make sure that the Vuforia marker has size 0.3 (30cm, 0.3m). The samples I provided already have this set correctly. If your bear is 0.3 units wide, it will show up as 30 cm wide in the real world.
    Units in your 3d modeling program are not the same as with Unity so make sure you know how the two relate to each other and how much scaling on the asset import your need to do to make things look right in the AR scene.

    Tanks for promoting UCS at LUUG ;-)
     
  37. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    UNITY CONSTRUCTION WORKER:
    Try dropping the Standard Unity 3rd person Construction worker in a UCS scene.
    This way you can see how large he looks.

    * Unity does not recommend scaling down too much as the translation/ rotation values getting very strange when animating.

    I have a UCS scene animating with the bear character. I'll send through the project once I get a handle on the scaling.. I've re-sized the character several times in Maya so the scaling matches that of Unity.

    p.s have you heard of " Oculus Rift " if not google it...
     
    Last edited: Oct 28, 2012
  38. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I will try in a few days when I have access to my laptop again. But I noticed one thing if you add a third person controller. That prefab contains a camera and as a result of it there seems to be a large object visible. This is actually the second camera background.

    If you add any prefab to a ucs scene, make sure that you remove all cameras from it. Adding a second camera in a ucs scene does not make sense as you hold the physical camera in your hands. You cannot replace that.

    I know about the problem of small scales. But if you want to have small objects in an ar scene behave realistically, you will have to set the scale to its true value. If unity can't cope with that, then that is very unfortunate. You can try to increase the scale and then modify the gravity value but I am not sure if that would work. Don't forget to modify the marker scale as well, otherwise the ad content will appear way too big. Have a look at the ucs documentation, there is some more info about scales in there.

    About the size of the objects. I mentioned this before but I will make my point again. If you add a standard prefab to a ucs scene which has a standard size, then a captule will most likely be 2 units high. This means it will show up as 2 meters high on your marker. This might not be what you want but it is suppose to work that way. Just scale it down.
     
    Last edited: Oct 28, 2012
  39. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Thanks for the reply..
    I re-scaled in Maya.. imported the character back in ( much better )
    Now learning joystick actions that call walk/run/jump/dance animations.

    The 3rd person character control does ask for a camera but I simply leave it blank.
     
    Last edited: Oct 29, 2012
  40. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Cool. Let me know if there are any other problems.

    By the way, I do know about the oculus rift and ordered a dev kit already :)
     
  41. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Great to hear, I also have one on order. Watched every Youtube vid. I could possibly find. Oh the pain of waiting .....

    I also ordered the LEAP MOTION https://leapmotion.com I think this coupled with the Rift will be amazing.


    Is it ok to lower the geometry plane in the Y axis .. I find that lowering the plane he walks on allows me to scale up the character somewhat, this alleviates the issues I was having with character movement due to scale. If I load other geometry, say for example a cube on another target marker, this will also have to be offset in the Y axis so the character does not simply walk straight under it.. yes ? I'm guessing that this is where the "Align" button becomes useful..... will play with this a little later.
     
    Last edited: Oct 29, 2012
  42. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    I pre ordered the leap motion as well some time ago but I never heared back from it. Not a good sign...

    Don't lower the geometry so it is lower then the actual physical geometry. This will make the perspective incorrect. If you want to solve the problem of too fast moving game characters you have to solve it the proper way, not with a hack.

    The reason your character moves too fast is because it is programmed to move a certain amount of units over time. Lets say that when holding the joystick in full deflection for one second, the character moves 5 units. The character is 1 unit wide so the speed at which appears to move is 5 times its size in one second. Now you scale the character down to 0.1 units. The joystick logic still works the same so in one second the character moves 5 units. The character is 0.1 unit wide so the speed at which appears to move is 50 times its size in one second so it appears to move much faster. So if you want to make it appear to move at the same speed then you have to change the joystick logic so it moves 10 times slower. Of course this is just an example but you get the point.

    This is basic logic and has nothing to do with UCS. Have a play with it.
     
  43. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    I'm now adjusting animation states. idle, walk, run , jump etc... the character moves about in UCS but legs not moving. hhmm... I had him running jumping on the mac.. but not yet in here. (using PlayMaker)


    Joystick works fine and Character moves about really well..... but I can't go from Idle state to walk then run ... will be great to see him running around and interacting with objects.
     
    Last edited: Oct 31, 2012
  44. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    If I hit play in Unity to view the scene, my character is re-located so it's impossible to see if the animation controls are working or not. Is there a way to keep him in view while the game runs ?
     
  45. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Get your project to run in a normal non-UCS scene first. That way you have control over the camera and can see what is happening so it is much easier to debug.

    Once your project is running as desired, get it to run in the UCS FrameMarkersManual scene on the PC side. This way you have control over the camera as well, albeit restricted. You will have to set the camera transform before you run the scene. Once the scene is running, you can't change the camera transform anymore.

    Once your project is running as desired in the FrameMarkersManual scene, you can run it on a mobile device.

    As far as controlling the character, have a look at the use of game object transforms: position, rotation, scale, and how that works. Be sure to spawn your character on top of a marker so you can find it. If you want to restrict the character movement so it doesn't run out of view, create a box (made out of separate planes) around the playfield using geometry.
     
    Last edited: Nov 1, 2012
  46. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Hi Elecman,

    I e-mailed the project to you since it is looking pretty good now. If you get some time out, take a quick look and let me know what you think.
     
  47. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    OK I dropped the new MarkerRecorder.cs script into the scene deleted the old one. I also made sure MarkerRecorder.cs is 2nd in the Execution order.

    but MarkerRecorder.cs is no longer populated when I look at Main Camera in the inspector window.
     
  48. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Don't drop the new MarkerRecorder.cs on the camera. Just overwrite the file in the directory instead. Re-install UCS to get the variables back, and then overwrite the old markerRecorder with the new one in the directory.
     
  49. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    will do...
     
  50. Mickman

    Mickman

    Joined:
    May 9, 2012
    Posts:
    153
    Tap to walk:
    I'm looking into tap gestures. so wherever I tap on a ground plane, the character walks to that point on the plane. I have it operating in a standard non UCS scene. How would I translate my touch plane into a UCS scene ? Would I simply save the whole scene out / import it into UCS and then make the touch plane transparent.