Nesh108

Members
  • Content count

    22
  • Joined

  • Last visited

About Nesh108

  • Rank
    Member

Contact Methods

  • Twitter
    nesh108
  1. Hello! I am working on importing an animation from http://voxelbuilder.com. There the animations are simply a set of frames which are switched in order. So, if I want to create an animation with 3 meshes I should do: 1. Show 1st mesh for 1/3 of a second 2. Show 2nd mesh for 1/3 of a second 3. Show 3rd mesh for 1/3 of a second 4. Show 1st mesh again. Logically that is fine but how can I do this properly? From each mesh I have the following information: vertexData.positions = positions; vertexData.indices = indices; vertexData.normals = normals; vertexData.colors = colorlist; Is it possible to create an animation by just setting the different indices/positions/normals/colors for each frame? It would be sweet if after `vertexData.applyToMesh(myMesh, true)` and `myMesh.bakeCurrentTransformIntoVertices()` I could also be able to start the animation with `scene.beginAnimation(myMesh, 0, 3, true, 1)`. Thanks! EDIT: To add more information: the amount of vertices, their positions and their uv's can drastically change from a frame to another, so the system should handle ANY mesh sequence and not the same vertices but in different positions.
  2. I see! I will retry and let you know @Deltakosh@Wingnut@gryff
  3. Ok, I checked and none of the babylon meshes have any vertex loaded. What's wrong? :/
  4. Ahah, of course not. I imported the obj into Blender and exported it using the Babylon exporter plugin. Unless I did something wrong Let me check with the debug layer
  5. Hello! I have been trying to load some OBJ files with Babylon. After a few attempts, I managed to get it up and running: BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; let loader = new BABYLON.AssetsManager(this.scene); loader.useDefaultLoadingScreen = false; let player_task = loader.addMeshTask('player_mesh', '', MESH_PATH, 'player.obj'); player_task.onSuccess = function (task) { // Meshes task.loadedMeshes.forEach(function(m) { m.position = BABYLON.Vector3.Zero(); m.scaling.x = 0.13; m.scaling.y = 0.13; m.scaling.z = 0.13; this.set_player_mesh(m); }.bind(this)); }.bind(this); } loader.onFinish = function() { this.babylon_engine.runRenderLoop(function () { this.scene.render(); }.bind(this)); }.bind(this); loader.load(); I had to create an empty 'player.obj.manifest', otherwise it would complain, and everything worked. All good here but when I try to load the same exact OBJ but converted into a .babylon file (I am doing this just because I need to import some animations), the mesh seems to be loaded but nothing gets displayed. I removed the 'BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true;' as it would not be needed and changed the filename to 'player.babylon. I tried testing it out on some playgrounds but still nothing. Are there other changes needed? Also, is there a way to just simply load an OBJ with animations without having to convert it to a babylon file? That would definitely save me tons of time... I have attached here the mesh I am using. Goku.babylon
  6. Hey @ILNILEY, What a coincidence! I was going to create a new thread exactly for this problem. Although I haven't fixed it myself, I can see already some obviously problems with your code. Take a look here: https://doc.babylonjs.com/extensions/obj Basically, you are not giving any path and the `Load(...)` method is for getting scenes, not objects. Here is how I am currently doing it and, although I am not getting any error and it gets loaded, I cannot access the `loadedMeshes` array: let loader = new BABYLON.AssetsManager(scene); loader.useDefaultLoadingScreen = true; // Set to false to remove the default loading let mesh_loaded_task = loader.addMeshTask(<TASK_NAME>, <MESHES_NAMES>, <PATH_TO_OBJ_FOLDER>, <FILENAME_DOT_OBJ>); mesh_loaded_task.onSuccess = function (task) { task.loadedMeshes.forEach(function(m) { console.log("Loaded!"); m.position = BABYLON.Vector3.Zero(); }); }; loader.onFinish = function() { engine.runRenderLoop(function () { scene.render(); }); }; loader.load(); Try this and enjoy. If anyone sees a problem with this, let me know EDIT: For some reason I was led to believe loadedMeshes was an array. Instead `forEach` needs to be used.
  7. UPDATE: Added new Babylon Voxel Clouds repo at https://github.com/Nesh108/babylon-voxel-clouds
  8. UPDATE: Added new Babylon Voxel Player repo at https://github.com/Nesh108/babylon-voxel-player
  9. Merci beaucoup, dude! (and to the great boss ) Let me know whenever you had the time to implement this, I'll be waiting
  10. Sweet! That's exactly what I needed! Thanks And yeah, I know they are the same but sometimes I don't mind to have a bit of verbosity if it makes it easier to follow. This is going to be one of the Babylon voxel modules I am going to publish, so I want people to know exactly what to change if they want longer legs or different sized arms
  11. Mmm, I am not sure I follow (and I did not see any difference on the playground). The problem is that my texture expects the faces to all have the same orientation, so each texture is positioned top up. Instead, for some reason, each face of a box has completely different orientation. The texture I am using is built around the assumption that you take a box and just open it out (see attachment). I cannot seem to be able to keep each face with the same orientation: http://www.babylonjs-playground.com/#1ALQPZ#20 (I used the exact same UV position for each face and, as you can see, they are all rotated in different ways). There must be an easy way to do a proper UV mapping as it really makes no sense that a box has faces with almost random orientations. At the moment it's possible to rotate textures by switching the values but just for 180 degrees, nothing for 90 degrees. Note: The reason I cannot just modify the texture is that I am converting Three.js libraries to Babylon.js. For this to work and make sense, someone moving their projects from Three to Babylon should have to make the least number of changes. So, if someone has a bunch of textures and, to use my library, needs to go through each of them and rotate portions of them (a pain in the neck), it might be make them not want to change after all. That's why the textures are pretty much static but I have a bit of freedom in the coding (still trying not to lose the simplicity of it).
  12. Hello! I am trying to apply a texture to my simple character. The character is made up of multiple boxes, so I am using a Solid Particle System. Until there all is good but when I try to apply my texture with UV mapping, each face of the box seem to have its own orientation. I couldn't find a way to rotate the face, so I researched on how to rotate the UV mapping but I could only rotate it by 180 degrees (by switching the values of x,y,z,w). Here is the playground: http://www.babylonjs-playground.com/#1ALQPZ#20 Any help? I would like to avoid using multimaterials and submeshes and that would make this simple task even more ugly and complicated.
  13. @aWeirdo Ohhh man! That's exactly what I want!! But I just managed to get the SPS up and running, it would be a shame to have to change it again @jerome That sounds like a great way to not have to use bones Could show me a small snippet with that? I am not sure I got it as translating the arms didn't change anything. (maybe it's total rubbish): http://www.babylonjs-playground.com/#1ALQPZ#16
  14. Yeah, I am trying to keep it more tied to Babylon than your engine. I use your engine for the demo and to show the intended usage, the core of any plugin that I will make should work with any other engine
  15. @aWeirdo Would that be easier than setting up bones and a skeleton for the character? @JohnK@jerome Do you think bones/skeleton are necessary or just a box as parent for each joint would suffice? It's just a very simple minecrafty character and I wouldn't want to over-engineer it if it is not strictly needed.