• Content count

  • Joined

  • Last visited

About foumfo

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Location
  1. Custom controls based on grid

    What If we did this animation using another framework, like jquery for example. Would it be too taxing performance-wise?
  2. Custom controls based on grid

    Even though I didn't understand much of your example, I do want the camera box's movement to be based on its locaspacel axis and not the globalspace. I could do it programmatically I suppose but it would take a lot of lines of code. I asked this in case there was a built-in way / method to handle local translations
  3. Custom controls based on grid

    Is it possible to rotate a meshes pivot axis when we rotate the mesh? For example, when we rotate the mesh clockwise, rotate the X axis clockwise also. So when you move the mesh forward, it will move rightwards compared to the global axis
  4. Custom controls based on grid

    Your first example works but only if add window.addEventListener("keypress", playerMovement, false); instead of keydown. By the way, your first lines are awesome! BABYLON.AbstractMesh.prototype is how we add properties to the mesh class correct?
  5. Custom controls based on grid

    //player window.player = BABYLON.MeshBuilder.CreateBox("player", {size: 1}, scene); var playerMovement = function(key) { console.log(key); switch(key.charCode) { //up case 119: case 87: player.position.z += 1; break; //down case 115: case 83: player.position.z -= 1; break; //left case 97: case 65: player.position.x -= 1; break; //right case 100: case 68: player.position.x += 1; break; //rotate anticlockwise case 113: player.rotation.y -= Math.PI / 2; break; //rotate clockwise case 101: player.rotation.y += Math.PI / 2; break; } } document.addEventListener('keypress', playerMovement, false); I just created this small piece of code, but all the transforms are instant. How can I animate them?
  6. Custom controls based on grid

    Ok then I'll create a box with my controls and then see how to make it a parent to a camera. I didn't know I could do that. The game I'm developing will be like the old school rpgs that players roam in dungeons step by step using a FPS cam
  7. Custom controls based on grid

    Thanks for the answer, I should have stated from the start that I'm talking about a First Person Camera game. If I understand correctly, you're talking about adding an invisible mesh as the player and have a FollowCamera attached to it, right?
  8. Custom controls based on grid

    I think I've had it all wrong from the start. Would it be possible to create my own function for controlling the camera without actually attaching it to the camera object? After I've detached the default keyboard controls ofcourse
  9. Custom controls based on grid

    I've read that already but its a bit difficult for me to follow. What I actually need is a small and simple example just for one control, pressing W and moving forward a specific amount of space
  10. Custom controls based on grid

    The question is how to alter a universal camera's controls in order to move on a grid block by block
  11. I'm developing a game that will have grid based maps - levels and the player will be moving through it one block per keystroke. I'll be using the keyboard as input just for the start, I'll add others later on. Every level is generated from a double array filled with 1 & 0. So I want to do here is for example: if I press W the player will move one block forward. if I press Q the player will rotate anticlockwise by 45 degrees.
  12. I've got a question: will the uriblob be scalable? Meaning, when the window is resized will the image also be resized but without any quality degradation. Plus I've been googling around for a way to convert my dynamic texture to URI and the only thing I've found is this by Deltakosh: I haven't a way yet to implement this code into mine, if its even possible
  13. Alright then I'll try to do that
  14. Ok then I'll use the fillRect method, thank you anyway for your work on this. Since I want to use the texture for my GUI, could I just implement it in it somehow rather than use it as a face texture for a plane?
  15. I'm already very grateful to you, so if you have the time now or in the future I would appreciate you showing me that method as well. Especially if that way is even more efficient