Picking objects though a portal?

Hello everyone.
I’m looking for a graphics system for my game.

How hard would it be to get Babylon.js’s object picking like BABYLON.ActionManager.OnPointerOverTrigger and BABYLON.ActionManager.OnPickTrigger

If I’m going to have to reimplimant everything to work with portals I might as well write my own engine. :stuck_out_tongue:

Hi @Alta and welcome to the forum. I am sorry but I do not understand your question?

What do you mean by

How do you want to get it?

What do you mean by a portal in the context of Babylon.js?

Like in the game Portal? Well, then you use render target textures for that right?

This is of course not supported by ActionManager, but could use a click handler, do a pick on the scene as described here: https://doc.babylonjs.com/babylon101/picking_collisions and then do a second pick by taking the pickedPoint from the PickingInfo, rotating it according to the inverse of the world matrix (if I didn’t get the math wrong). This yields you the right x and y coordinates to do a second pick on the subscene (the one behind the portal).

I have to confess I have never used ActionManager much; it’s a neat abstraction for simple applications but I’ve always found it too limited for games. It could be improved through the ability to pass data between triggers and actions (like the PickingInfo), but that would probably mean a lot of spaghetti code behind the scenes in Babylon itself :wink:

I mean the method to do non-Eulidean spaces like GitHub - HackerPoet/NonEuclidean: A Non-Euclidean Rendering Engine for 3D scenes.
@earthendev the modern why is to just stencil off the rest of the scene then render the view thru the portal

Because I thought your question was about picking, not rendering. No idea if you can use the stencil buffer like that in Babylon.js

This guy: https://www.youtube.com/watch?v=kEB11PQ9Eo8&feature=youtu.be (linked from your github link) uses render targets as well (at least according to his video). He claims the effect he’s after is not possible in Unity, probably because of the non-euclidean aspects.

Here is a tutorial with portals and render textures in Unity where it works: https://www.youtube.com/watch?v=cWpFZbjtSQg But he’s not doing anything non-euclidean of course.

I mention Unity only because it’s comparable to Babylon in its abstraction level, so most stuff that is possible in Unity will be in Babylon.js as well.

The non-euclidean idea is really cool. You could make a highly surreal game with it. I hope you find a solution because I’m looking forward to your game :slight_smile: