Jump to content

How to create a shape which can only show part of edges


JZ7878
 Share

Recommended Posts

@JohnK

 

I changed some configuration of your demo, and saved as https://www.babylonjs-playground.com/#W8L8IP#1 , actrually I just need a 2D(XoZ) product, but I found that in that way, if I commented the rotating operation and changed the width of the line, it will flash very quicky while I move/zoom the scene, and the line is not so clear.

 

I did not understand the way you mentioned for 2D, could you explain more on how to use sprite to do that?

Link to comment
Share on other sites

The flashing is because of z-fighting with the textures. You prevent this by separating the meshes (line 210). Having stopped the rotation the direction of separation has to change from z to y https://www.babylonjs-playground.com/#W8L8IP#2

As you want the shape too be in XoZ plane and to rotate, then sprites will not work as they always face the camera. You can achieve the same idea with a transparent image on the ground plane ( the image used would need improving but shows the idea) https://www.babylonjs-playground.com/#8UZ3JD

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