Jump to content

False Camera with Controls


Pryme8
 Share

Recommended Posts

Hi p8, happy new year.

https://www.babylonjs-playground.com/#14RS6Z#1

Would this help? 

Camera1 view... is not attached to canvas, so it is frozen.  Yet camera controls in ITS view port... can control the other 3 cameras.

I'm not exactly sure what you are trying to do, but perhaps with the help of scene.activeCameras ... more options.  You probably knew about scene.activeCameras array already, though.

Perhaps there are some options with layerMasks and renderingGroups, too... where only certain mesh/cams... get the shader/post-process applied to them.

One camera would see all the mesh WITH the post-process, and the other... wouldn't.  *shrug*  Just speculating. 

Sometimes when people strive to accomplish a task, they get stuck in a one-way-to-do-it rut.   It is easy to forget about sneaking-around in the dirty back-alleys.  :D 

Link to comment
Share on other sites

Basically I want to not display the camera but hyjack its controls and transform matrices to be input into my ray marching shader.

I was attaching the false camera on line 160, but from what your saying though because its not actively rendering to a view its not calculating anything then?

Link to comment
Share on other sites

https://www.babylonjs-playground.com/#QJE3YB#9

that line effectively does nothing that I can see.

What I am trying to achieve is have the false camera have the controls still attached to the canvas, even though it is effectively not rendering anything.

the main Camera will never move, and does not need controls attached it is just there to render the two triangles with a shader that is raymarching a scene, but I would like to take advantage of all the cool camera controls we have without having to do a bunch of scripting.  So the false camera can be moved and manipulated just for the purpose of hijacking its position, target and up vector.
 

Link to comment
Share on other sites

Kinda unrelated, but do you have any idea why it gets distorted if you move the camera around and get the raymarched object near the edge of the plane.

Seems like something screwy is going on and I'm not sure what so I am assuming it has to do with something I am doing, was just hoping someone might know why.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...