Michuspo Posted November 17, 2018 Share Posted November 17, 2018 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, Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 17, 2018 Share Posted November 17, 2018 hi you most use GUI tools for that i guess but i just try make it by custommaterial a circle on box not circle on screen https://www.babylonjs-playground.com/#1KUUC3#1 https://www.babylonjs-playground.com/#1KUUC3#2 with rounded box Quote Link to comment Share on other sites More sharing options...
Michuspo Posted November 17, 2018 Author Share Posted November 17, 2018 Hi NasiamiAsl, Thanks for your quick answer! It is great! Do you think is possible the point always will be oriented to the camera, in other words, always you see a Circle? Thanks, Quote Link to comment Share on other sites More sharing options...
Michuspo Posted November 17, 2018 Author Share Posted November 17, 2018 Let me add some snapshots, from any point of view is a circle! My problem is I can not keep the same radius as you do! ? Thanks, Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 17, 2018 Share Posted November 17, 2018 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 Sebavan 1 Quote Link to comment Share on other sites More sharing options...
Michuspo Posted November 17, 2018 Author Share Posted November 17, 2018 2 minutes ago, NasimiAsl said: hmm you r good in making challange https://www.babylonjs-playground.com/#1KUUC3#6 p1 is object center position Yesss!! That's it!!! It is amazing!! ? Thanks Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 17, 2018 Share Posted November 17, 2018 https://www.babylonjs-playground.com/#1KUUC3#8 ssaket 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 17, 2018 Share Posted November 17, 2018 notice that p1 is position of inside (try keep it close to center) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.