Share this post

Link to post

Share on other sites

I basically want to take a plane that always faces the camera if its in its frustum, and raymarch a object on it like lets say a tree. Then be able to move around in the scene and keep the raymarched object in the middle of the plane but update the position of the camera on the shader so you can view it from all angles.

Share this post

Link to post

Share on other sites

Looks like I just need help with the "lookAt" Math. I need some sort of calculation that will make it so its not like looking through a window, but at an object and so the axis arrows stay in the center of the plane no matter what your view angle is.https://www.babylonjs-playground.com/#ZFUV4U#14 <- for anyone who wants to just move around the raymarched scene. The camera controls are attached to it.

Share this post

Link to post

Share on other sites

So let me re-explain. We have a plane that is billboarded and on that plane is a shader that is rayMarching another scene or object. If we move the camera around in the scene and look at the raymarch plane it is like your looking through a window (kinda).

What I am trying to do is figure out the projection math behind keeping an object centered in the rayMarched scene but still keep the ability to move the camera around it. So effectively I could make the plane look like a cube that you can walk around, but is only really two polygons with a shader on it.

Im thinking I need to get a reflect angle and get the difference between the cameras target and the output plane then apply the inverse to the rayMarch camera matrix?