Jump to content

Updating scene without rendering


UP_AND_ATOM
 Share

Recommended Posts

Well what I'd like to do is draw lines on a different canvas based on the position of the 3D objects in the scene. I don't want to actually show the scene, but instead just use it to calculate the locations of objects. 

 

When I do what you suggested, it just hides the background of the scene but the objects are still rendering. Is there a method that does everything that scene.render() does, but without actually drawing to the canvas?

Link to comment
Share on other sites

I am not sure if I understood the use-case, but I'll give it a shot :-)

 

You have two canvases, one is a webgl and the other is (probably) a simple 2d canvas. the one is on top of the other, probably using CSS. Why wouldn't you use CSS (display hidden for example) to hide the webgl canvas? 

Link to comment
Share on other sites

I am not sure if the actual rendering takes so long. Never tested, but I understand that it is not needed, when you don't want to show anything on the webgl canvas.

The fastest solution I would have is this:

http://www.babylonjs-playground.com/#1WNTNW

Simply overwrite the render function of the rendering manager, and it won't render a thing. It will, however, follow the changes in the scene (open your console and move the camera with the arrows, you will see the values change).

 

I am not sure how helpful this is, it is actually just a hack :-)  Maybe DK can help more.

Link to comment
Share on other sites

I want to update the location of each mesh that's visible by the camera, but avoid any overhead from lighting and rendering, since I'm not using Babylon.js to actually do any displaying. I just want to be able to get the x and y (screen) coords of each vertex of certain meshes. I'm familiar with requestAnimationFrame, but I haven't been able to figure out what exactly I need to update every frame to keep the Babylon.js simulation going. 

 

Does that make sense?

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...