RafaelJ

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. Hi, It's work, but it isn't so easy for complex scene. I made a code something like your code: var time = 0; var start = false; var force = 0.0; var mass = 0.0; //button start: document.getElementById("Start").onclick=function(){play = true}; //button restart; document.getElementById("Restart").onclick=function(){play = false}; scene.registerBeforeRender(function () { force = document.getElementById("Edit1").value; mass = document.getElementById("Edit2").value; acceleration = force / mass; if (play) { time += 1; sphere.position.x += acceleraton * time *time /2; } else { time = 0; sphere.position.x = 0; }; }); I'm thinking about a second way by change the scene and rechange to first scene for reload, like this solution: http://www.babylonjs-playground.com/#1B3R9A#2 I think that babylonjs need something like: scene.restart(); scene.pause(); Or a set of common functions for scene control, like find in others engines. For example, in blender game engine we have: bge.logic.KX_SCENE_RESTART bge.logic.KX_SCENE_SET_SCENE bge.logic.KX_SCENE_SET_CAMERA bge.logic.KX_SCENE_ADD_FRONT_SCENE bge.logic.KX_SCENE_ADD_BACK_SCENE bge.logic.KX_SCENE_REMOVE_SCENE bge.logic.KX_SCENE_SUSPEND bge.logic.KX_SCENE_RESUME Thanks, Rafael J.
  2. Hi, I made updates in my playground with things I learned with Dad72 member. http://www.babylonjs-playground.com/#1ADV28#68, this don't have the error. I need the functions for the buttons work. Thanks, Rafael J.
  3. How do I create Start, Stop and Restart buttons? I'm learning babylonjs to teaching it for my physics stutents. My plan is to teaching to create physics simulations like phet colorado sims but in 3d. First, I need a standard GUI with Play, Stop and Restart buttons that works with physics engines. I made a playground for sample it: http://www.babylonjs-playground.com/#1ADV28#67 click two time run for wok after castor error. I want to stop the sphere free fall and restart the scene. Which functions or commands do I need to use for it? Thanks, Rafael J.
  4. Thanks for attention, I'm physics and game programming teacher. This month I started with babylonjs with a class and I hope to use it with more depht with my future students. The main advantege of babylonjs is the playground and the simple and easy setup. I changed from Unity and Stencyl, I have published some games with Blender Game Engine (link bowling game for kids), but the .blend or .exe format is not friendly nowadays. Html5 is the present and future format for web games, Blend4web is cool, but don't have a easy setup, so babylonjs is OK for my proposal and classroom works. In the next month, I'll create a subdomain in my site about babylonjs for brazilian people interested in learning this great tool. Rafael J.
  5. Hi, I want to use dynamic texts to show variable values on screen. My first attempt was to use castorgui.guitext, but the guitext function updateText() don't work in my test at playground. Why is updateText not work in my case? Playground sample: http://www.babylonjs-playground.com/#1ADV28#41 the issue is at line 42 And why is old guitext content stuck at screen after new run? How can I reset guisystem for clear olds elements content at each new run? Thanks, Rafael J (Brazil)