ancientholiday

Members
  • Content Count

    17
  • Joined

  • Last visited

About ancientholiday

  • Rank
    Member

Recent Profile Visitors

665 profile views
  1. If the boolean does not work then I would like another way to do a cross-section of a group of meshes. Can this be achieved by making something transparent beyond a plane?
  2. I am trying to perform a Boolean subtraction operation on an imported Mesh (skull.babylon). I have downloaded the demo from Babylon CSG. Demo: http://www.babylonjs-playground.com/#NZPX4 The operation seems to work on native meshes, but not on imported meshes. Has anyone tried this before? I used the loader to bring in the mesh, and then tried to reference it in the subtraction operation. So far, no luck Thanks indexCSG.html
  3. How to make intersect and subtract work for imported meshes? Please see file attached. I am trying to make boxes cut skull.babylon mesh however it does not work when i make var a = the scene.mesh[0]indexCSG.html thanks,
  4. Your code has an interesting strategy. Instead of switchng camera names, you actually create a new camera on button click that has the same camea name. it seems there must be something that prevents changing the active camera names after run-time rendering has started.
  5. Ok. I get it. As a true / false boolean situation, I can change the cameras. I can also apply this to buttons by attaching a button to the condition: switchCam = !switchCam; Thanks!
  6. i tried to add button 1 and button 2 attach to different cameras. It does not work var b1 = document.getElementById('b1'), b2 = document.getElementById('b2'); //var currentCAM= camera; console.log(currentCAM); function show() { alert(currentCAM); } b1.onclick = function() { var currentCAM = camera2; show(); return currentCAM; console.log(currentCAM); }; b2.onclick = function() { currentCAM = camera; show(); return speed; console.log(currentCAM); }; console.log(currentCAM);
  7. whenever i attach click event to myCamera, it does not change the camera.
  8. Hello, In Babylon JS, only one camera is active at a time, howver you can construct multiple cameras in a scene. How can you allow the users to swtich cameras on a button click. For example, in this Three Js scene, you can hit 1 or 2 button to switch cameras, making an active camera false or true. https://stemkoski.github.io/Three.js/Multiple-Cameras.html The only example i have seen in Babylon JS is the Train example, however there is no explanation of how to switch the cameas on button click. Thanks, Moses
  9. Yes, wingnut, that is exactly what I meant. How to pass the numbers to the function. It is moreso a basic programming question. Anytime you call the function and pass the values to it, then you will have the program run the function. that is what you did in line 79. Thanks very much for the example. AH
  10. Hello, I understand that this is for an ArcRotate Camera. however, what is the numeric value of toAlpha? How is that being determined? by a mouseclick or something else? is toAlpha a keyword in Babylonsystem? the key frame will start at camera.beta, which is the current value of the the camera's beta in the script, and it ends at "toBeta." What is the numeric value of toBeta if it is not pre-defined in a variable?
  11. I would like to animate my camera from current position to another pre-determined position. Mattx264 posted the following function in 2014 According to Mattx264 function, how does the script know where the end position is located? Does toAlpha, toBeta, toRadius recieve a number? If not, how does the code know where the end value of these parameters are? Can anyone demonstrate this code in the playground? I dont understand how the end position of the radius, alpha, and beta are located in the script. There is no variables declared about them. Thanks, ah BEST ANSWER mattx264, 23 April 2014 - 04:20 AM Thank you @Deltakosh. I wrote this function, may be it will help somebody. var ArcAnimation = function (toAlpha, toBeta, toRadius,position) { var animCamAlpha = new BABYLON.Animation("animCam", "alpha", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysAlpha = []; keysAlpha.push({ frame: 0, value: camera.alpha }); keysAlpha.push({ frame: 100, value: toAlpha }); var animCamBeta = new BABYLON.Animation("animCam", "beta", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysBeta = []; keysBeta.push({ frame: 0, value: camera.beta }); keysBeta.push({ frame: 100, value: toBeta }); var animCamRadius = new BABYLON.Animation("animCam", "radius", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keysRadius = []; keysRadius.push({ frame: 0, value: camera.radius }); keysRadius.push({ frame: 100, value: toRadius }); animCamAlpha.setKeys(keysAlpha); animCamBeta.setKeys(keysBeta); animCamRadius.setKeys(keysRadius); camera.animations.push(animCamAlpha); camera.animations.push(animCamBeta); camera.animations.push(animCamRadius); scene.beginAnimation(camera, 0, 100, false, 1, function () { }); }GO TO THE FULL POST
  12. matt, I am confused what is the actual numeric value of toRadius, toAlpha, and toBeta? How can you tell Babylon what these values are? How does the function know what the final value of toRadius, toAlpha, and toBeta are if they are not declared in the script? How do you define the end position?
  13. Nevermind, the code is working now. I found another tutorial. :-)
  14. I made a very simple Babylon project based on the tutorials. I cant seem to get anything to work on it. Can someone take a look, I must be doing something wrong that is very simple: http://www.mosesbydesign.com/def2.html
  15. Yes, I am looking for something like that! I am new to bablyon.js and it seems that you did not need much code at all to implement the scene. However instead of animating a box and parenting the camera (never parented anything before), I would like to just animate the camera in blender and export all the movement to babylonjs. I would like to animate the camera on a click event. In threejs alot of math is required to make the camera follow a spline. It seems much easier to bake the animation into the camera from a blender camera path. If that is what you have done, I will follow that example and go from there!