Is there a possibilty to do Virtual Reality using BJS

Hello guys,

Firstly, I want to thank everyone who helps me to move forward my project “my subway stations looks good now”.

Now I have cameras everywhere in the station, and I want to add some AR effects, I just thinking if someone of you has an idea to helo me

thank you best guys ever seen,


Not used VR or AR however…

For VR (as per your title) see Use the WebVR Camera - Babylon.js Documentation

There have been a number of discussions on AR on the forum. A search for “augmented reality” in the forum should bring them up.

About AR, here a read:

I think you start to build AR in BJS
I just opend this PG
I can see only my self in camera :stuck_out_tongue: there is no box, can any one of you help me to understand

Invoking our AR overlord @syntheticmagus

[Thanks for the ping, Deltakosh!]

Hi Anes,

The Playground link you’ve got there is for a marker tracker, which is our first experimental (alpha) Babylon CV project for augmented reality. It looks for markers in the scene, then displays something where it finds that marker; so if you don’t have a marker, it won’t do anything.

If I may ask, can you tell me a little more about your intended use case? What kind of AR are you hoping to add?

1 Like

I also believe for certain devices, like Hololens 1/2 & Magic Leap One, that there is another, marker less way by using a WebXR camera & setting the background color to clear. I do not have one of them to test this though.

Hello @syntheticmagus
thanks for ur reply … well I explain what I’m going to do :

I’ve developed an interactive 3d interface of a subway station here is a link of the station I’ve added lot of interaction controls (like controlin escalators, elevators, possibility to create paths to different equipment …etc).

Now I’ve cameras in my station and operators can look forward (I thought to add some AR), so like that operators can i.e see the real escalators with information added in AR, or they can control them up and down … etc

because I used BJS in my first project and people here they really help me, so I asked question about AR here :slight_smile:

what kind of marker should I use to work :thinking:


Hi Anes,

Sounds like a pretty cool use case. Are your cameras articulated? Or do any of the things you want to add information about move around unpredictably? If not, you might not need real AR (or, more broadly, CV) capabilities at least to get started. If the stuff you want to provide information about is always in the same part of the camera feed, you can just overlay the information over the feed directly and not worry about tracking.

If there is something in the scene you want to provide information about that won’t be in a predictable location on the camera screen, however, the technique you use to track it will depend heavily on what it is you want to track. If, for example, you wanted to be able to see whether a door was open or closed, there are quite a few ways you could tackle that, one of which would be to put a marker (of basically any recognizable kind) on the door and visually checking the state of that marker in the camera feed. However, if you want to overlay information about people, that’s trickier because you can’t put a marker (or any other predictable visual indicator) on people, so you’d need more sophisticated recognizers to attempt something like that. So, in sum, what kind of CV technique you should use really depends on three things:

  1. Your subject (that is, what your system is trying to perceive in the world).
  2. How you expect your subject to behave. (Will it be mobile in the frame? Will it move between cameras? Will it always look the same?)
  3. What constraints your system needs to function under. (Do you need to get results real-time? How many cameras do you have? How much compute power? What other information do you know about the scene apart from camera feeds?)

Sorry if this seems like a more burdensome line of questioning than you might have hoped for; and the good news is that if your scene contains only predictably-placed subjects, you don’t have to worry about any of this because you know where the subject will be. But if the subject’s location is unpredictable, it quickly becomes a trickier question, so I really do need to know more about the use case in order to provide a helpful answer. :smiley: