Search the Community

Showing results for tags 'mesh'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 179 results

  1. Hi All, It's been a while... I've got a question re models/meshes imported from Blender unit size. What would be the optimal unit of, say, 1 meter? As far as I understand, if a chosen unit is too small, it will affect reflections/shadows etc?
  2. Hello everyone. I have a question. How can I add just one mesh from Blender into an existing babylon scene? I created a babylon scene with several meshes. Now, I want to add a model of a car from Blender into existing scene. Thank you.
  3. I have two .babylon files. One with meshes and skeletons, but no animation. The other one has skeletons and animation, but no meshes. Turns out BABYLON.SceneLoader.ImportMesh doesn't load the skeletons at all, because there's no mesh in the file. Is there any way to import .babylon file with just skeletons and animation?
  4. If I merge meshes using the Mesh.MergeMeshes() function I get a merged mesh whose "center" / "origin" is located at world location (0,0,0). I would like to change this "center" to the center of its bounding box. How do I do this?
  5. Hi, I am trying to move mesh relative to ArcRotateCamera alpha value. Basically it should move the same direction as mouse is moving (up, down, left, right) , works fine with 0 angle but different angles need to flip x/z and change their directions. What the best way to calculate direction vector from angle and 0 angle direction? Working example: http://www.babylonjs-playground.com/#W8MYRB#7 (angle 0) Not working: http://www.babylonjs-playground.com/#W8MYRB#10 (angle 55) I tried to rotate vector using: const matrix = BABYLON.Matrix.RotationAxis(BABYLON.Axis.Y, camera.alpha); const movement = BABYLON.Vector3.TransformCoordinates(new BABYLON.Vector3(x, 0, z), matrix);
  6. Hello everyone, I am trying to export a scene as a babylonjs file; and I keep getting this error: ERROR: self.backFaceCulling &= material.game_settings.use_backface_culling ERROR: 'NoneType' object has no attribute 'game_settings'. I have unchecked culling for the mesh but it still shows the error. How would you go about this? Thank you for your time.
  7. Background: I am a newbie in game development I'm creating motion sensor game Air Table Tennis on Babylon.JS in which user can control the paddle of table tennis with his/her smartphone. I am using gyroscope/rotational data of mobile in the form of Quaternion to avoid Gimble Lock and sending the data to server(nodeJS). So Gyro data is coming from mobile through node JS. Problem: So, I am using Quaternion, But I am unable to map my paddle as my device. (paddle is not exactly in the position where my mobile is currently now, although moving on x,y,z axix give me correct result). So my question is how to calibrate/Map 3D object same as my mobile device? @[email protected]@Deltakosh Sir kindly help me, I'll be very thank ful. Thanks in Advance
  8. Hi everyone! I'm building an infinite runner and exporting predefined blocks from Blender. In BJS I create instances of those block meshes exported from Blender and place them dynamically to create pathway for a character. So my aim is to use exported meshes as `blueprint` for instances creation. What's the best way to hide a mesh exported from Blender and use it only as a reference to create instances of the mesh to place them dynamically? Currently I'm just placing base meshes outside the skybox mesh to hide them and then create instances of those base meshes and place the instances inside skybox mesh where I need them to be. Although that works I'm just wondering is there any better/proper way to hide base meshes?
  9. Hi , I am trying to solve small geometry problem but somehow cant solve it in 3d I generated boxes in circle, http://babylonjs-playground.azurewebsites.net/index2_5.html#LWNSLQ#2 but cant rotate them so that they look forward centre along circle line
  10. Hello everyone, I'm trying to get a label system which could work like https://jig.space/view?jig=v4Ga2VKw I'm using the 3ds max exporter to export the meshes and I wanted to use the pivot point as a base to place the label. Maybe there is a better way to do it. When I create my Group2D (containing a line, rectangle and text) and set the trackNode property to use the mesh, I can see that the pivot point is not used. It looks like it might not event been exported (I attached the file) since the pivotMatrix is null. Maybe I'm missing something ? Infos.babylon
  11. Hi, I wonder what is the best way to get only these meshes which are visible by camera at the moment. I know there is octree implementation in babylon, but Im not sure how to use it. I've seen this https://github.com/BabylonJS/Babylon.js/wiki/Optimizing-performances-with-octrees but still have problems to make it work. If someone could explain (write a piece of code or pseudo code) how to make it. Lets say I have 5 cubes on my scene and a free camera. I would like to have a function that would return meshes which are visible in a viewport of my camera. Thank you, Regards V.
  12. 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
  13. When i have a scene with a bunch of static scenery props like : I have a bunch of separate LOW POLY INVISIBLE collision meshes, some grouped and some for each piece ... These low poly invisible meshes are use for Camera Collision (mesh.checkCollision = true) and used as the 'Collision Mesh' in my BJS Toolkit for things like Physics Collision and Mesh Intertection... Is Working Great. Now when it comes to optimizing the scene .... i have a 'Static Batching' feature that will combine all the meshes on the 'Babyon Static' batching layer by material. Now at right before i cache each mesh for static combining i generate is collision mesh based of the 'Collider Component'... Ok... Say i end up with 250 separate low poly INVISIBLE pieces (so draw calls should not be AS MUCH of an issue) but the 'CHECK COLLISION' computation that has to go on for each mesh ... m.checkCollision = true. Would it be BETTER for the 'Check Collision Computation Performance" to keep EACH mesh collider separate OR combine all LOW - POLY mesh colliders into one big mesh... I don't know if the invisible collision mesh implementation would be the only case where it is better to have separate meshes (even though on same default material and even though they are actually invisible) than combine meshes... Purely based on if the the mesh.checkCollision would perform BETTER checking things on 250 separate low poly pieces OR using the same vertex count of all those 250 pieces combined into a single mesh... set with checkCollision = true; WHAT SHOULD I DO
  14. Hi all, BabylonJS is great. I have a question, maybe someone here can help : Is it possible with the current API (BJ2.5 ou 3) to write directly to the ArrayBuffer used to upload data to the video card? In my program, I would like to generate and update a dynamic mesh and I need it to happen as fast as possible (no freezing, eventually might have to be done in a web worker). In fact, quite often actually, I need to update muliple meshes at once within a frame. I'm worried about the overhead of updating a JS array that, I'm guessing, is copied into an ArrayBuffer to feed to webgl. Can I bypass the JS data format? I would like to "lock" the buffer and write to it. Am I overworrying? I think not.
  15. Hi all, I've implemented a basic-functionality of a cloner system and I'd like to hear your opinions and design/concept-suggestions for further develepment and finishing my work (if you're interested at all). I decided to use a working title "SCS" for "Simple Cloning System" and here are the core features and concepts : Cloners: given one or several meshes, either clones or instances will distributed in a specific manner. If more than one mesh is provided, the meshes are distributed alternatively. Additionally, cloners can be nested, so it is possible to clone cloners. Each cloner can have several Effectors (in particular order) to influence the Scale/Position/Rotation parameter of a clone (or cloner). A sensitivity parameter controls this influence for a cloner. Following Objects are designated: RadialCloner: radial distribution where following parameters are recognized: count, radius, offset, startangle, endangle, Effector-sensitivity for Position, Scale and Rotation, alignment-flag, orientation. LinearCloner: linear distribution where following parameters are recognized:count, offset, growth, Effector-sensitivity for Position, Scale and Rotation. An interpolation-mode-flag determines, if the clone -parameters (Scale/Position/Rotation) are interpreted as "step" or "end"-values. MatrixCloner: coming soon (clones will be distributed in 3D space) PlanarCloner: coming soon (clones will be distributed in 2D space) ObjectCloner: coming soon (clones will be distributed in relation to the internals of a given mesh (vertices, edges, triangles ...) RandomEffector: influences Scale/Position/Rotation of a clone with repeatable random values, controlled with an overall "strength" parameter. Not quite finished, but basically working. FormulaEffector: coming soon, influences Scale/Position/Rotation via text thought to control from outside (html-page). StepEffector, TimeEcffector, DelayEffector and much more ??? So, enough for the moment, you can see and play with some scenes: LinearCloner,RadialCloner,RandomEffector radial-linear-radial-cloner linear-radial-linear-cloner PS: I need some advise if I should upload the sources to github if you're interested. Should I upload it to my own github space or to BABYLONX ? If the latter, do I have to send a pull request? Sources are written in typescript
  16. I've exported my scene from 3Dsmax. Now I want to get individual meshes and want to do something with them. How can I select a mesh in the scene? with its name or ID... ?
  17. Hello, I have noticed that there is a problem with UV mapping, if I use a dynamicTexture on my mesh, imported from .babylon file. I am sure that my mesh has proper UV mapping, I have checked it by using standard texture. If I use normal texture on this mesh, everything is ok. If I use dynamic texture on BABYLON.Mesh, everything is ok. If I use dynamic texture on my mesh, I have seen something like that: I can't find an example on the playground with a mesh with proper UV mapping, so I have chosen the skull Playground: http://www.babylonjs-playground.com/#1NQC5D#3
  18. I'm trying to implement double jump (one extra jump while in the air). In order for it to work also when the character is falling of a ledge or higher platform without having initiated a jump from the ground I need a way to tell if the player is currently in the air or not. How can i tell if a mesh is currently not colliding with anything? The only way I have found so far is the "intersectsMesh(mesh,precise)" function, but this requires me to check against a specific mesh. Would I need to loop through all meshes with collision in the scene to check if I am currently colliding with any of them, is there any better way to do this (seems rather inefficient). What I think I'm looking for is a "isCurrentlyColliding" value on my character mesh or perhaps it can be solved differently?
  19. In this example I set a parent to the ground and then rotate it. I would expect that the absolute position of the ground would change but it doesn't... The weirder thing is that getAbsolutePosition returns always the same vector - the vector it returned first time I called it. For instance in this example the absolute position does change according to the rotation but after I get an absolute position for the first time it doesn't change. Am I missing something?
  20. Hello! I am working on a voxel project and creating a very basic voxel player. It has a box as head, a bigger box for body, etc. I created the whole thing like this: this.player_head = BABYLON.MeshBuilder.CreateBox(PLAYER_HEAD, {size: 1, updatable: true}, scene); this.player_body = BABYLON.MeshBuilder.CreateBox(PLAYER_BODY, {width: 1, depth: 0.5, height: 1.5, updatable: true}, scene); this.player_right_arm = BABYLON.MeshBuilder.CreateBox(PLAYER_RIGHT_ARM, {width: 0.5, depth: 0.5, height: 1.5, updatable: true}, scene); this.player_left_arm = BABYLON.MeshBuilder.CreateBox(PLAYER_LEFT_ARM, {width: 0.5, depth: 0.5, height: 1.5, updatable: true}, scene); this.player_right_leg = BABYLON.MeshBuilder.CreateBox(PLAYER_RIGHT_LEG, {width: 0.5, depth: 0.5, height: 1.5, updatable: true}, scene); this.player_left_leg = BABYLON.MeshBuilder.CreateBox(PLAYER_LEFT_LEG, {width: 0.5, depth: 0.5, height: 1.5, updatable: true}, scene); // Head this.player_head.parent = this.player_body; this.player_head.position.y += 1.25; // Right arm this.player_right_arm.parent = this.player_body; this.player_right_arm.position.x += 0.75; // Left arm this.player_left_arm.parent = this.player_body; this.player_left_arm.position.x -= 0.75; // Right leg this.player_right_leg.parent = this.player_body; this.player_right_leg.position.x -= 0.25; this.player_right_leg.position.y -= 1.5; // Left leg this.player_left_leg.parent = this.player_body; this.player_left_leg.position.x += 0.25; this.player_left_leg.position.y -= 1.5; Since I need all the meshes to be treated as a single mesh, I merged them with: BABYLON.Mesh.MergeMeshes([this.player_head, this.player_body, this.player_right_arm, this.player_left_arm, this.player_left_leg, this.player_right_leg]); Until here, all beautiful and nice. But a problem arises: I want to be able to move the arms, legs and head to make some sort of animation for walking but it doesn't seem to work. My player object has the references to all the meshes before the merging, so I thought I would still be able to transform them even after the merging. What's wrong then? Also, is there perchance a better way to create a bunch of simple meshes, apply a specific material to each of them and then 'merging' them into 1 bigger BABYLON.Mesh without losing their individual texture/material? MergeMeshes destroys the materials of the children objects, which is quite bad :/.
  21. I was wondering if it's possible, and if yes, then how, to get more responsive movement when using getPositionToRef to attach a mesh to a bone assigned to some skeleton from an imported model. I think it's the same when using attachToBone. http://www.babylonjs-playground.com/#1N9CSW#2 The position and rotation of bone #6 (right hand) is used to position the sphere. Imagine it was a sword or a gun. Try moving the camera around, and notice the movement of the sphere. It seems to be a little behind, and not as crisp as one would have hoped for. Am I missing something here?
  22. Hello everyone, long time no see! So i'v ran to an issue where i'm trying to attach meshes to bones from another import. I'v this torso which is built from 2 meshes and this torso assembly holds the skeleton. Then i'v another model and when i'm trying to place the import directly to head bone for example the model flips around Z axis and goes somewhere it doesn't really belong. I'v attached an image which hopefully explains more than my english does What i'm doing wrong? any ideas? - best regards, eljuko
  23. Silly title, I know. I'm not sure how to achieve this, and I'm sure a PG is not necessary, if this functionality actually exists. Imagine the simple and common version of a FPS-setup. You have a camera, and a mesh or more in front of this camera, usually a couple of hands and a gun of some sorts. Now, when I hit a wall face-first, part of the hands/gun model will clip through the wall, and we sure don't want that to happen. Is there some way to always render the hands/gun models in front of everything else, igoring depth? I looked at z-index, renderingGroups and masks without luck.
  24. Hi, I hope someone can help me. I want to export my Blender model with the Babylon.js Blender Exporter and import it in my App. In general this works fine, but I have one problem that I can't solve. In Blender I added a parent connection between a plane and a bone of my armature. The idea is that the plane should move if the bone moves. In Blender this works fine, but not with Babylon if I import the exported scene (tried my app and the BABYLON sandbox). Now I have two problems (which may be related to each other ?) 1. The plane is in a different place in Babylon (compared to the Blender model) 2. The parent connection is not exported and if I set the connection in my app directly after the import the plane moves to a weird place (but it follows the bone) Would be nice if someone can have a look at my Blender model. In my model there are actually two planes LED.L and LED.R and a want to attach these planes to the Neck bone of my ReetiArmature. Reeti.blend Reeti.babylon
  25. I've been checking this documentation, but didn't find anything I can use. Please, help.