Brijesh Posted April 25, 2017 Share Posted April 25, 2017 Using ScreenSpaceCanvas2D i draw one Ellipse2D around my mesh. Now i want to set its property such a way that when windows size is changes Ellipse position respect to mesh remain same.some thing like responsive. Please help me...!!!!!!!!!!!!!!!!! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 25, 2017 Share Posted April 25, 2017 ping @Nockawa Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 26, 2017 Share Posted April 26, 2017 Hi guys. I tried an experiment... https://www.babylonjs-playground.com/#18AMT4#6 Using a WorldSpaceCanvas2d with ellipse2d, I rotated, postioned, and parented its worldSpaceCanvasNode (the mesh that worldspacecanvas2d's are painted-upon). See lines 59-64. It works. No border allowed on ellipse2d apparently... but not sure. Also, these don't do well on bumpy terrains, as you can see. Might as well use a plane with a circle texture on its standardMaterial, eh? Better resolution with a plane and circle texture. BUT, this method, and a plane-with-circle-texture... will do fine on window/canvas resizes. No problems there. It is a work-around. Not sure if these things will work for you, Brijesh, but... perhaps a temporary solve until Nockawa can do some tests, later. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted April 26, 2017 Share Posted April 26, 2017 @Brijesh I'm sorry, but I don't understand what you would like to achieve, can you be a bit more explicit, give use case, a in progres playground and/or screenshots. Thanks Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 26, 2017 Share Posted April 26, 2017 Hiya @Nockawa. Just to speed things up a bit, he is probably ellipse2d- encircling a mesh (with screenspace ellipse2d), using group2d trackedNode. The Ellipse is probably not tipped-down to match ground, like mine is. ScreenSpace mesh-tracking Group2d's are staying properly aligned... after canvas/window resizings... in your test cases, right N? I think that is what BriJesh is saying. Tracknode prims not staying aligned with mesh after resize. But maybe, he only "placed" the ellipse on the screen at the proper place to encircle the mesh, and is not setting trackedNode AT ALL. Ok, I'll shut up, now. I'm getting into EVERYONE ELSE'S business, today, for some reason. (Wingnut hears someone in the crowd yell "EVERY day!"). heh Quote Link to comment Share on other sites More sharing options...
Nockawa Posted April 26, 2017 Share Posted April 26, 2017 Btw, @Wingnut I made a more pretty version of your PG: https://www.babylonjs-playground.com/#18AMT4#7 Well, ScreenSpace Tracking is obviously not handled the same way as WorldSpace, I would like to understand what the user want to achieve with screen space, because I still don't understand. Brijesh and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 26, 2017 Share Posted April 26, 2017 Hey, thanks for the better ellipse edges and general cleanup! COOOOOL! http://www.babylonjs-playground.com/#18AMT4#8 I wanted to edit my "snippy" comments in this PG's "description" metadata field, but no edit. It came out of my fingers, and now I have to live with it... I have to sleep in the bed I made. heh. THIS kind of ellipse-encirclement is what I think B-man is doing... screen-tracking a mesh. I think he had no trackNode set on his Group2d, or maybe no Group2d to do trackNode-with. This does screen resizings just fine, well done on that, N. I wish center of prim == center of mesh automatically, without fiddling with stuff. We'll talk. See my ellipse scaler based-on camera radius (for mousewheeling)... in the renderLoop? It works exactly backwards. I couldn't make my mind think-up how to reverse it. I'm too doped-up this late in the day. heh. Help welcomed. Thanks again for response, and fixings, Noxxy. Love ya, man! Brijesh definitely has some toys to play-with, now... and fresh knowledge about worldspace's trackNode, and Group2d's trackNode. I think both features are excellent. Quote Link to comment Share on other sites More sharing options...
Brijesh Posted April 27, 2017 Author Share Posted April 27, 2017 Thanks @Wingnut and @Nockawa both of you for helping me....I resolved my problem. Thanks a lot... Wingnut 1 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.