Jump to content

Free Camera with a mesh in Front


Recommended Posts

Hi all


I have a free camera which has a mesh which in front of it which is 70 cm wide (x) and 110 cm length (z) with it's pivot point at the its center. Now I want this mesh to be constantly in front of my free camera when the camera is moving. The problem starts when I start to rotate the camera. I want the mesh to be in the center of the screen (in the direction of the camera) and at a fixed distance from the camera. Is that possible? Does it involve complicated math calculations? Would a followcamera do the job?



Link to comment
Share on other sites

iiceman: Thanks, parenting solved my problem. I found out that after parenting the position of the parented mesh is relative to the parent camera and not absolute. If I have an ellipsoid on the mesh, should that be defined as relative to the parent camera? Is there a way of tracing the positions of an ellipsoid or seeing it visually?

Link to comment
Share on other sites

I assume you are referring to this: https://doc.babylonjs.com/tutorials/cameras,_mesh_collisions_and_gravity -> 4 - Object vs. object collision ... right?

I think the position is always relative to the mesh, because you set it as a property of the mesh.

There was a short discussion about it that I remember: 

...but with no real solution. I know that offset behaves strangely. What I did was just try different value and see what fits best. Maybe somebody else has a better idea. Would be great if it could be visualized somehow! (Maybe with @jeromes ribbon from the above link?)

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.

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.


  • Recently Browsing   0 members

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