JackFalcon

BABYLON.Augmented Reality ...

Recommended Posts

Ah-ha! Left-handed by default -> me too... 

Great reminder -> use Right Handed System ... sometimes. 

arerrar1.png.e9bc35fe3dc3b0938053bf4e27c57e00.png

Interesting effect. Flipped the y-axis... 

This may help what I was seeing, and with the colored axis, it helps...

Thank you.

 

Share this post


Link to post
Share on other sites

Hello, under aFalcon energy, im working on porting ar.js to babylon.js

it got some questions. 

q. i would like to set the camera position.quaternion.scale in babylon ? how can i do that ?

q. i would like to change the FOV of the camera. how can i do that ?

q. i would like to put my own projection matrix for the camera. Not one recomputed with fov,near,far,aspect etc... One projection matrix 4x4 of mine. in theory it is already needed to support WebVR. How can i do that ?  

 

Thanks :)

Share this post


Link to post
Share on other sites

Wow, @jeromeetienne has come to visit.  WELCOME, JE!  Too cool. 

(He's a super-star of 3D land, ya know?  I say we build him a nice home on Lake Babylon, and stock-up his fridge with steaks and beer.)  :)

Nice to have you with us, JE!  Thanks for the contribs and comments. 

Now, enough of my superstar-drooling (Wingnut hugs JE)... it's time to get back on-subject.  :)

I have been thinking about Bluetooth-like things for AR.  For AR viewers, we might not always carry a database of AR-able things in the vicinity.  That means local AR-ables will need to transmit their existence... to the viewer/scene... perhaps with Bluetooth or similar. 

You turn your headgear-toward, or aim your camera-at... a city newspaper dispenser, for example.  The newspaper dispenser is transmitting "preferred AR representation data", and the phone/pad/headgear receives that, and uses it to identify and place the AR info into the view.

And yes, newspaper dispensers would need batteries, from then-on.  Self-identifying info-transmitting AR-ables.  hmm.  (I'm new at this AR stuff.  Can ya tell?)  :)

And, I didn't get back on-subject.  JE has questions.  Time to go to work.  camera.fov = whatever.  camera.fovMode = BABYLON.Camera.FOVMODE_VERTICAL_FIXED;   Here's a playground search for fovMode.  Search-in-code is handy.

I don't have answers for camera position quaternions (never heard of position quaternions, only rots)... and yes, setting your own viewMatrix SOUNDS like something we do regularly, but that doesn't mean that I know how to do it.  More comments from smarter people... coming soon.  But 'viewMatrix' is a good playground search term.  Talk soon.

Share this post


Link to post
Share on other sites

Great!  camera.fov works. (and it is in radian) learning babylon.js :)

yet another question :

q. how to make a plane visible on both side ? i tried what is below.. but the .twoSidedLighting = true doesnt change a thing for me. any hint ?

        var material = new BABYLON.StandardMaterial("texturePlane", scene);
        material.twoSidedLighting = true

Share this post


Link to post
Share on other sites

Here is  the current status - derived from @aFalcon example

 https://github.com/jeromeetienne/AR.js/tree/dev/babylon.js

in case somebody wanna look (and hopefully fix :) )

the conversion between three.js camera position and babylon one can be found here https://github.com/jeromeetienne/AR.js/blob/dev/babylon.js/examples/manual.html#L126-L161

 

Share this post


Link to post
Share on other sites

To make a plane with two  light reflecting faces, just set the optional parameter sideOrientation to the value BABYLON.Mesh.DOUBLESIDE at construction time

http://doc.babylonjs.com/tutorials/discover_basic_elements#side-orientation

http://doc.babylonjs.com/tutorials/mesh_createxxx_methods_with_options_parameter#plane

var plane = BABYLON.MeshBuilder.CreatePlane("plane1", {sideOrientation: BABYLON.Mesh.DOUBLESIDE}, scene);

If you want it simply visible from both sides, you can simply disable the backFaceCulling of its material

plane.material.backFaceCulling = false;

 

Share this post


Link to post
Share on other sites

Not sure to understand your need, but you can get the camera projection matrix from http://doc.babylonjs.com/classes/3.0/camera#getprojectionmatrix-force-rarr-matrix-classes-3-0-matrix-

var projMat = camera.getProjectionMatrix(true); // passing true forces the immediate computation before the rendering step

source :

https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/babylon.camera.ts#L442

Share this post


Link to post
Share on other sites

Hey, don't forget about us blind mad scientists... who do console.log(camera) and then use the browser object inspector to see all the "knobs and switches" on the camera.  (which we then blindly turn/throw, and see what blows-up).

Source?  What the hell is THAT?  :D

BTW:  Nice work, JE and assistants!  AR.js is lookin' sweeeeeeeet.

Share this post


Link to post
Share on other sites

Update: see video below

- i ported to the most recent ar.js api (which handle all tracking under a single API)

- i used babylonCamera.freezeProjectionMatrix(), seems to work

 

It is getting there. but still some issues. im not sure what is happening.

If people wish to step in and make it happen faster, the whole code is available here https://github.com/jeromeetienne/AR.js/tree/dev/babylon.js

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.