Jump to content

2D Point always same size in a 3D Mesh


Michuspo
 Share

Recommended Posts

Hi,

I'm trying to create a 2D point (or circle) on a mesh, but I need it will be the same size (maybe in pixel). Do you know how to do it? Now, I'm trying to create and sphere and use fragment shader for the color, but as you can see, the 2D Point changes depending of the camera position. Any idea?

Thanks,

816699590_ScreenShot2018-11-17at7_06_27PM.png.76d7972f35d4c78bf8b9837cb6cddd39.png

 

1675779088_ScreenShot2018-11-17at7_06_33PM.png.2bfaa0f5eb18f7e17f2705feca9b0632.png

 

Screen Shot 2018-11-17 at 7.06.40 PM.png

Link to comment
Share on other sites

hmm :)  you r good in making challange :)

https://www.babylonjs-playground.com/#1KUUC3#7

p1 is object center position   

but for make exact circle may be we use gl_FragCoord

gl_FragCoord base on pixels so that can make  i need think about that :)

https://www.babylonjs-playground.com/#1KUUC3#8 that is close too 

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