Numa Posted June 28, 2016 Share Posted June 28, 2016 Hello again, Have a look at this playground: http://babylonjs-playground.com/#1SASV5#2 It's a very simple cube with a label attached to it. If you rotate the camera around slowly, you will notice that the line flickers, and sometimes even is drawn in the opposite direction: however if I print the value for the end point of the line, it is 100% correct every frame. On this screenshot, the end point values printed are 100, 100 when clearly the line is drawn to -100, -100. Also, if I lock either x or y to a hard-coded value, the flickering is gone: see this playground line 67, I hardcoded a Y value of 100 instead of getting it from the mesh position: http://babylonjs-playground.com/#1SASV5#3 Any idea why? Thanks Quote Link to comment Share on other sites More sharing options...
Nockawa Posted June 28, 2016 Share Posted June 28, 2016 7 hours ago, Numa said: Hello again, Have a look at this playground: http://babylonjs-playground.com/#1SASV5#2 It's a very simple cube with a label attached to it. If you rotate the camera around slowly, you will notice that the line flickers, and sometimes even is drawn in the opposite direction: however if I print the value for the end point of the line, it is 100% correct every frame. On this screenshot, the end point values printed are 100, 100 when clearly the line is drawn to -100, -100. Also, if I lock either x or y to a hard-coded value, the flickering is gone: see this playground line 67, I hardcoded a Y value of 100 instead of getting it from the mesh position: http://babylonjs-playground.com/#1SASV5#3 Any idea why? Thanks Hello, I'm away from home on holidays, I'll check as soon as I can, worst case thursday morning. I'll keep you in touch. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted June 28, 2016 Share Posted June 28, 2016 @Numa first thing I do when I come back from holidays is to make the settings of Lines2D changeable. Then we will see if the issue is solved this way. There's also a weird ZBuffer clipping effect against the cube, I'm very interested to understand what's going on there! Thank you for reporting. I can see the use case you're trying to develop and I think the best thing is to make the appropriate changes in Lines2D, then test again. The Trello card corresponding to the evol is here: https://trello.com/c/DQ4FC9KL Numa 1 Quote Link to comment Share on other sites More sharing options...
Numa Posted June 28, 2016 Author Share Posted June 28, 2016 Thanks for the quick response! I'll be waiting Quote Link to comment Share on other sites More sharing options...
Numa Posted July 7, 2016 Author Share Posted July 7, 2016 Any luck @Nockawa ? Quote Link to comment Share on other sites More sharing options...
jerome Posted July 7, 2016 Share Posted July 7, 2016 he's currently moving with his family and has no internet connection for now Please just wait a little more Quote Link to comment Share on other sites More sharing options...
Numa Posted July 7, 2016 Author Share Posted July 7, 2016 oh yeah no problem at all, I'm just really excited about this library Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 7, 2016 Share Posted July 7, 2016 hello @Numa yep, I just get back in France and my house is a jungle of boxes, a total mess, your dev is the next one I'll do and I think I'll start tonight! I will let you know about the progress later on today. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 7, 2016 Share Posted July 7, 2016 @Numa in the PG you shared at the first post you access the Canvas2D._v and _m objects, all underscored based objects are supposed to be private and you should not use them. I actually don't event know what's supposed to be in there by the time your code is using it. Anyways, that's not the main issue I agree, what you should ideally do is create only once your Lines2d object and then each beforeRender set a new array of points, this should work (but I've started to test it locally and looks like it's not). Please try to provide a PG without the _v _m, thanks. Quote Link to comment Share on other sites More sharing options...
Numa Posted July 9, 2016 Author Share Posted July 9, 2016 Thanks Nockawa, I've had a look but I'm not really sure how what to replace _v and _m with, in the source code they're only set once, and they're set to: Canvas2D._v = BABYLON.Vector3.Zero(); Canvas2D._m = BABYLON.Matrix.Identity(); I couldn't find anywhere else where those values are changed, yet the matrix one does change every frame if you rotate the camera hehe. Is there a public function to access the canvas' matrix ? I based my code on the Canvas2D.prototype._updateTrackedNodes function, which is of course accessing the private variables. I tried using a single line and updating the array as you suggested and indeed it doesn't work, the points are never updated ^^. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 9, 2016 Share Posted July 9, 2016 7 hours ago, Numa said: Thanks Nockawa, I've had a look but I'm not really sure how what to replace _v and _m with, in the source code they're only set once, and they're set to: Canvas2D._v = BABYLON.Vector3.Zero(); Canvas2D._m = BABYLON.Matrix.Identity(); I couldn't find anywhere else where those values are changed, yet the matrix one does change every frame if you rotate the camera hehe. Is there a public function to access the canvas' matrix ? I based my code on the Canvas2D.prototype._updateTrackedNodes function, which is of course accessing the private variables. I tried using a single line and updating the array as you suggested and indeed it doesn't work, the points are never updated ^^. Yep, the points are not updated and I'm working on it, but I actually have almost no time to code right now... Basically changing the points are changing the ModelKey of your instance (because it need a new set of 3D resources to be rendered) and this is not working well right now... It's still on the top of my todo list, but I don't know when I'll be able to start working again, next Monday I hope. What do you call the Canvas' Matrix? For a ScreenSpace canvas you have access to the globalTransformation matrix and for WorldSpace canvas you have to get the matrix from the mesh associated to the canvas (the property name is something like WorldSpaceCanvasNode) Quote Link to comment Share on other sites More sharing options...
Numa Posted July 22, 2016 Author Share Posted July 22, 2016 Hi @Nockawa, any news on this ? I tried having a look myself but got very lost in the depth of babylon ^^ If you're too busy is there anyone else around here that could take a look at it, maybe? thanks so much! Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 22, 2016 Share Posted July 22, 2016 11 hours ago, Numa said: Hi @Nockawa, any news on this ? I tried having a look myself but got very lost in the depth of babylon ^^ If you're too busy is there anyone else around here that could take a look at it, maybe? thanks so much! Sorry but I didn't have the time to code since I moved in... Well, good news is I'm done with all the stuffs I had to do, bad news (for you) is I'm on a short holidays until next wednesday and I can't dev, but promise I get on this one next wednesday, I'll finally have time to resume my work on bjs and Canvas2D. Quote Link to comment Share on other sites More sharing options...
Numa Posted July 22, 2016 Author Share Posted July 22, 2016 Ok cool! Moving is the worst, enjoy your holiday Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 26, 2016 Share Posted July 26, 2016 Hi @Numa I'm getting back to coding, but I have one bug to fix before starting yours but the good news is: I'm back! Quote Link to comment Share on other sites More sharing options...
Numa Posted July 26, 2016 Author Share Posted July 26, 2016 Yeaaaaaaaaaaaaaaaaaaaaaaahhh!!!!! Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 27, 2016 Share Posted July 27, 2016 17 hours ago, Numa said: Yeaaaaaaaaaaaaaaaaaaaaaaahhh!!!!! Your issue is the hardest to fix, I have several "simpler" one to deal first to unblock people, I'll try to manager yours asap, I won't wait more than a day to get back on it. Quote Link to comment Share on other sites More sharing options...
Numa Posted July 27, 2016 Author Share Posted July 27, 2016 1 minute ago, Nockawa said: Your issue is the hardest to fix, I have several "simpler" one to deal first to unblock people, I'll try to manager yours asap, I won't wait more than a day to get back on it. Thanks, no problem I'm able to do bunch of other things in the mean time now that I have the opacity property Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 28, 2016 Share Posted July 28, 2016 On 27/07/2016 at 9:27 AM, Numa said: Thanks, no problem I'm able to do bunch of other things in the mean time now that I have the opacity property Hello @Numa the PR was just submitted, I have your PG working locally so I expect it will work once the PG will be updated! Thanks for the patience! Numa 1 Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 30, 2016 Share Posted July 30, 2016 @Numa your PG is working now I believe http://babylonjs-playground.com/#1SASV5#2 jerome and Numa 2 Quote Link to comment Share on other sites More sharing options...
Numa Posted July 30, 2016 Author Share Posted July 30, 2016 ooooooh! Beautiful!! I think it's fixed yes! Is it the correct way to get the line ID and dispose + recreate every frame or should I try to update the points dynamically? Thanks so much man you're a legend! I can't wait to try it Can I just pull the latest version of babylon off github? Quote Link to comment Share on other sites More sharing options...
Nockawa Posted July 30, 2016 Share Posted July 30, 2016 6 minutes ago, Numa said: ooooooh! Beautiful!! I think it's fixed yes! Is it the correct way to get the line ID and dispose + recreate every frame or should I try to update the points dynamically? Thanks so much man you're a legend! I can't wait to try it Can I just pull the latest version of babylon off github? I've modified your PG to make it looks like my local test: http://babylonjs-playground.com/#1SASV5#4 You will see that you don't need to dispose (and you shouldn't), just set the new array of Points and it's working. Yep, the code is in the latest version of the official repo of babylon you can get it there, on the dist/preview folder I guess. Quote Link to comment Share on other sites More sharing options...
Numa Posted July 30, 2016 Author Share Posted July 30, 2016 ok perfect thank you thank you thank you! Oh i'm so happy Nockawa 1 Quote Link to comment Share on other sites More sharing options...
Numa Posted August 7, 2016 Author Share Posted August 7, 2016 @Nockawa I found another glitch http://babylonjs-playground.com/#1SASV5#9 when the 2 lines are too close together, one or both disappear. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted November 4, 2016 Share Posted November 4, 2016 sorry, I totally forgot this thread, I tried to check your PG and couldn't find the issue. Any chance it was fixed in the meantime? Can you check? Thanks 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.