How do I Fake AR

0 favourites
  • 4 posts
From the Asset Store
Each style is designed to enhance immersive soundscapes, from dystopian worlds to nostalgic, vintage settings.
  • Think Pokemon Go

    The balloons need to float from top to bottom - that I can do. I'm stuck because, as you can see in the image, if I move the camera to the right or left the balloons keep moving up, but they don't move out of view.

    What I need is for the purple sight, in the center, to stay put, but if I move the camera to the right, the balloons need to continue moving up, But Also need to move off to the left - as if they are in front of the camera. And other balloons need to be floating up - as if the balloons are around the person - right, left, in front of, behind, above and below.

    I think that is what is referred to as 'Fake AR' - I can't figure out how to do it. Is there a step by step tutorial on that?

    I know it can be done because before I subscribed I emailed my prepurchase questions and was told it would, but not a lot of details as to how.

    Please & Thank You.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Depends on your setup. but

    The simplest way is to Every tick > set balloon.X to balloon.StartX + ( Camera.X + Center.X )

    balloon.Startx is an instance variable and you set it at start of layout to each balloon.X

    So if your center is at 960 ( middle of 1920 x 1080 HD resolution ) your camera starts there.

    Now if you move camera 100 px to the right balloons will move 100 pixels to the left relative to their original position

  • BadMario,

    Thank you for your reply.

    I may have a little more learning to do before all that makes sense to me. I understand most of it, like I know how to make an instance variable. I'm going to play around with implementing that now - see if I can figure it out.

    I was thinking that I needed to use the touch object to use the accelerometer and inclinometer, but your way sounds better.

    Last night I got frustrated and stripped it all down and started again. Now I basically have the camera and the balloons

    If you're interested.

    drive.google.com/drive/folders/15jCZxNvFDa_ipEco5M1m7I7-9OMWp3Jj

    Thanks for your help.

  • dazedangels

    if I understand what you are trying to do, there is more too it. since the User Media object is not actually moving on the canvas, you will need another way to tell if the user is moving their phone. To do that, use the Touch object - the Alpha/Beta/Gamma values tell the device's orientation...

    from the manual:

    "Alpha is the compass direction in degrees. Beta is the device front-to-back tilt in degrees (i.e. tilting forwards away from you if holding in front of you). A positive value indicates front tilt and a negative value indicates back tilt. Gamma is the device left-to-right tilt in degrees (i.e. twisting if holding in front of you). A positive value indicates right tilt and a negative value indicates left tilt."

    So, you will have to use those values to calculate how to position the balloons on the screen, (or if they are on the screen)...

    And, if you want the user to be able to "walk through" the environment (REAL AR), then you would also have to use the Geolocation object to be able to track their position. That would also require the user's permission and will help drain their battery faster... and I don't know if that would work indoors.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)