• Content count

  • Joined

  • Last visited

  • Days Won


iiceman last won the day on May 8 2016

iiceman had the most liked content!


About iiceman

  • Rank
    Advanced Member
  • Birthday

Profile Information

  • Gender
  • Location

Recent Profile Visitors

915 profile views
  1. @spoboyle I copied the wrong link in my previous post, I fixed that now. Here is another one that might be closer to what you need: http://www.babylonjs-playground.com/#2GZZLD#3 It pretty much all about the scaling and how the text fits the texture. I made a rectangular texture to better fit the lateral surface and tired to fill it up as good as possible. The rest is done with the uScale of the texture. I think it's rally hard to imagine how ti changes when you change some values. My approach was to slow change the values and just try things out until i thought it fits. Some difficulties that might be worth mentoning: the x and y where you draw the text are not 0,0 because: the font has offset on x and y the drawing starts in the lower left corner of the texture. start with a value close to your font size to make sure the text is actually on the texture and not below font size is not equal to the pixel size the text has on the texture... I don't know why..might depend on the font you choose if the size of the texture doesn't fit the the actual shape of your surface things get stretched (that may be the reason for your red lines), so if the lateral surface is a rectangle, try to get your texture as close as possible to that. You can specify {height: 128, width: 768} when creating the texture. I tried to fit 6 Cs so I chose width = 6 x height, but again, it doesn't fit perfectly, just try changing the values in slow steps. If you can keep the texture size a power of 2 (remember reading about that vaguely, a quick google search gave me articles like that, if you need to know more: http://www.katsbits.com/tutorials/textures/make-better-textures-correct-size-and-power-of-two.php) Well, that's all I can think about now, I hope it helps. Good luck and let us see the final result or tell us if you need more help! By the way: for text on image it might be the easiest to draw on transparent background and then just create another slightly smaller cylinder for the texture below: http://www.babylonjs-playground.com/#2GZZLD#4
  2. That looks fun! I like this setup: http://www.babylonjs-playground.com/#1C2HFL#4 Performance is still good and you got some randomness and you can see how the fast ones start pushing the slow ones ...just like in real life!
  3. Hmm, it works better with the cylinder mesh: http://www.babylonjs-playground.com/#2GZZLD#1 Edit: I copied the wrong link, I meant this one: http://www.babylonjs-playground.com/#2GZZLD#2 So I assume it might be something about the UV mapping for the mesh that you import? But I don't know enough about that to help you find the problem there, I fear :-/ You need that custom mesh? Or could You build that wheel with a Cylinder, too? Here is something else I did a while ago that does something similar using DynamicTexture: http://p215008.mittwaldserver.info/BabylonDev/MultiDice/
  4. Hi spoboyle and welcome to the forum! I once did something like that: http://p215008.mittwaldserver.info/space_paint/ Maybe you can look at the source and find something useful. Basically you take the image first and draw that on your dynamic texture, then draw your text on top. I don't have time right now, but if you can't figure it out I'll make a playground later
  5. Seems like you are working on the same project as @JamesStudent So I assume you already know how to place the spheres, right? And you know how to connect them, right? So whats left? You already said it yourself: For each of the spheres, draw a connector to any other spheres as long as that other sphere is not the current sphere itself. And then you are done!
  6. Okay, new try: http://www.babylonjs-playground.com/#9U086#125 Added an ObjectMove Event as described in the Fabric Docs https://github.com/kangax/fabric.js/wiki/Working-with-events to update the position of the second text Limitations: only works from right to left it seems once you move over the edge you have only the second text left, you probably have to updated both texts no matter which one is dragged So, still far from perfect...but maybe you get the idea. There might be a better way, but thats the only way I can image how it could work at the moment.
  7. Yeah, you are right... I was pretty sure I tested it yesterday and it worked, but I guess it doesn't... strange. Sorry, not sure what went wrong (or what went right yesterday :P) If I have a bit of time on my hand I give it another try!
  8. I am expecting an A+ on this one though!
  9. var spheresCount = 20; var alpha = 0; for (var index = 0; index < spheresCount; index++) { var sphere = BABYLON.Mesh.CreateSphere("Sphere" + index, 32, 3, scene); sphere.position.x = 10 * Math.cos(alpha); sphere.position.z = 10 * Math.sin(alpha); alpha += (2 * Math.PI) / spheresCount; } -> http://www.babylonjs-playground.com/#2KXLF6#0 Stolen from here: http://babylonjs.com/Demos/CustomRenderTarget/
  10. Hi there James, welcome to the forum. jerome already showed you a way how to do it, but I remember there was pretty much the same request a while ago here: Here is a playground from that discussion that shows a way how to do it, too: http://www.babylonjs-playground.com/#1RWE59#12
  11. Since JavaScript treats everything as a reference it might not be that hard, is that what you want: http://www.babylonjs-playground.com/#9U086#124 (only did it for the text)
  12. Well, I think you need to draw it twice to compensate the jump from one end of the texture to the other end: http://www.babylonjs-playground.com/#9U086#123
  13. @jpdev awesome! looks really cool and I love following your progress!!!
  14. http://www.babylonjs-playground.com/#RM9ED#0 -> it logs the submeshs in the console with console.log(sphere.subMeshes); Based on the values for the verticesCount it seems like its has equally divided the mesh if that's what you mean... but I don't know for sure.
  15. Maybe that's what you want: http://www.babylonjs-playground.com/#RM9ED#0 mesh.subdivide(x); mesh.createOrUpdateSubmeshesOctree(capacity, maxDepth); https://doc.babylonjs.com/tutorials/Optimizing_Your_Scene_with_Octrees#optimizing-collisions-and-picking https://doc.babylonjs.com/classes/2.3/AbstractMesh#createorupdatesubmeshesoctree-maxcapacity-maxdepth-rarr-octree-classes-2-3-octree-lt-submesh-classes-2-3-submesh-gt-