Search the Community

Showing results for tags 'mesh'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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 222 results

  1. Mesh Intersect Timing

    Hi, I have two meshes. In my createScene function i have a point where I check if they are intersecting. The thing is I would like to first move one of the meshes (change its position) and then IMMEDIATELY check if they intersect BEFORE waiting for the next rendering iteration. The problem is if i change the position of one mesh so that it intersects with the other and then immediately check for intersection it says they don't intersect (I guess because the actual position is changed only while the render loop is called). Is there anyway to solve this? Thanks!
  2. Hello, i created a litle game, based on the car demo in the playground, Now i have noticed that when i click with the mouse (left, middle, right) the car bounce a litle for and then back. also when the key is released. I have created an video: Have a look on the console. I dont think this is not an problem with my game logic, more with the canvas. Like you drag & drop the frame. Has anyone an similar problem or a fix for me ? I dont know what to do.
  3. Hi, I do have a mesh with a huge amount of vertices (Meshlab say 1800000 vertices, after unifying duplicates still 304000 vertices). Its stored in an STL File. I import it as a mesh as shown in the example below It's doing well on a PC with FPS of almost 60fps. But using mobile devices I end up with 10-20 FPS. So, I am looking for an optimization solution. I read all the HowTo on your Web page. Since its only one model - instancing or cloning does not help. I thought about using LOD or Auto LOD. But trying that the framerate totally drops. See here (lines 43-45) From Unity I know that they split or slice models with lots of vertices in slices of max 16k vertices. Is there a way in BabylonJS to split huge meshes into slices of sub-meshes to improve FPS performance? Another idea is to keep the amount of vertices/triangles for the main areas of the model and decrease it for others. Do you support such a feature? What would you suggest to improve the performance while keeping the information? I know its a trade-off. Thx for your hints. See you
  4. Hello again, I'm trying to figure out how to check for collisions using intersectsMesh method. The problem is that when I start my scene, the intersectsMesh callback is called since I believe the meshes start at the origin point of the world on the first render before they are moved. The PG above demonstrates the problem. If you open up the browser's developer console, you would see "SHOULDNT HAPPEN" when the mesh intersections occurred. Any tips on how to prevent this problem? Thank you!
  5. Hello , It's my first post in the forum. I need your help. When i click in a mesh , i need the camera get in front of the Mesh. Thanks for your answers.
  6. Quad like object in Phaser 2?

    I used to use quad objects in Starling framework where you could move vertices of a quad rectangle and set their colors and alphas. I searched for the same functionality in Phaser but apparently it's available in Phaser 3: Can anything like that be done using Phaser 2?
  7. Rim Effect

    HI everybody! Is it possible to add a rim effect on mesh like in this image : Thanks, Pichou
  8. Hi all! Please tell me what is Difference between position, rotationQuaternion of mesh and bone. Because when I apply same position and rotationQuaternion animations to same hierarchy parent-child meshes vs bones I get difference results - (bone-animations result seem wrong). How to correct bone-animations? Thanks
  9. Looks like animations stop updating when they go outside the frustum... this is quite annoying when trying to render stuff which is close to camera, like avatar's body in first person view. When your hands go outside the view, they never come back I tried attaching invisible meshes in animations but it has it's drawbacks and it feels like i'm fighting (a losing battle) against the system. Any suggestions how to force the animations to keep running even when they go outside the view?
  10. Hello, I noticed some jagged edges on the diagonal lines. Is there any way to get rid of them? I have tried using the ffxa post processing, but it still does not remove them completely. Why do they even occur? It's just a straight line. Sorry if I can't give any more input in this issue, but my knowledge of graphics is limited. Here's a babylonjs playground example. Attached is a screenshot of how it looks in the scene of my project. The diagonal lines don't look very appealing for a production ready project.
  11. What is the correct image format to use your own decal texture? I tried a lot of different images in my project but none have worked so far except the babylon one. I guess the image must be png and black on white? Here is a playground with one image test :
  12. I try to optimize one of my scene and to do so I adapt my code to use createInstance instead of clone. But as a result my scene (fps) is slower with createInstance than with clone when it should be the opposite right? To sum up my code, here is the steps I follow : - import mesh - clone mesh and add material (because one mesh can have 2 different materials) - create instance mesh - add in the scene At the third step, I get a better fps when I use clone instead of createinstance. Do you have an idea? Thanks!
  13. I,m trying to develop something like this using Babylon.js (The example is implemented in Unity 3D): I suppose this can be implemented using a shader. The user can move a sphere with the inverted normals, and the shader will have to calculate if this sphere is painted depending on its position in the z buffer. Is it possible to do this using babylon ShaderMaterial? Thanks in advance.
  14. Hey guys, So I have had the chance to delve a little bit more into Babylon.js and I really find it great. I am developing an online multiplayer game on it and while testing I have encountered a strange problem. So I have this simple terrain and a mesh which moves on a pick event. I have integrated Babylon-navmash extension and so far it has been working great. What seems a little strange to me is that sometimes the mesh disappears from the screen ( in movement ) only to reappear again some frames later. In other cases it stops while being invisible. When I have a camera with it as a target, the camera itself shows a blue screen when the mesh disappears. I think probably its a render problem. I am not sure though. Any thoughts ? Since the camera loses the target after it disappears I don't think its camera related but...again, I am not sure. On a further note, I am not using physics neither collisions just some ray picking. And I am also using a shadow map with a texture of 512 size. I am rendering only the shadows of this mesh, for the static ones most surely I will bake the shadow maps. Thanks again for this awesome tool! Best Regards, Relative Null.
  15. Hi there, I am very new to babylon and 3D area, I saw this demo from tutorial and I have some question, 1) I want to import a mesh of a character, why would it end up with an 'array' of newMeshes and skeletons. 2) If there is an array of meshes, why it only change the position of the one at '0'(newMeshes[0]) and it works for all meshes. 3) Same for skeletons, in this demo, there is only one skeleton, but if there are more than one, should I loop for every skeleton to call beginAnimation? skeletons.forEach((singleSkeleton) => { var animation = scene.beginAnimation(singleSkeleton, 0, 100, true, 1.0); }); I know these questions might be very basic, is there any article recommended?
  16. Hi all, just polishing off another pixi based game. Another one for mobile, so looking now to see if we can scale back some of the effects when using canvas for the lower end devices. I'll be dropping out particle effects, and a lot of the animations as it's rendering a bit slow atm, but one issue I've come across is with spine meshes. To save load time I've designed some assets to be flipped, but have noticed the mesh wireframes are visible on all those that are flipped. eg. grave.scale.set(-1,1); This is only visible on canvas (webGL is perfectly fine). Anyone know if there is a quick fix for this, or reckon I will have to duplicate the spine elements and flip the assets? (Last resort really) Thanks in advance!
  17. Is there a way to clone an imported mesh to use it in a different scene? I try to change the _scene parameter of the mesh like that : this.mesh._scene = newscene; but I got an error. It seems like I must import all my meshes twice in both of my scenes. Unfortunetly it will increase the loading time. Looking for suggestions! Thanks
  18. So.... to my great disappointment - yes, another one of those - it looks like parented meshes don't work with physics engine. Is there any workaround? I think it's impossible for me to unroll all parenting in the project, it would break animations and god knows what else... BTW it looks like @Wingnut is currently working on similar issues (poor physics support). thumbs up to you for all the great work
  19. Hello, guys. I'm newbie on 3d programming. I want to display sprite like GUI that has a function linkWithMesh. but it hasn't. In this example, sprite's position from a mesh is changing, not fixed. the mesh must have BILLBOARDMODE_ALL. how to make sprite to track mesh's position like GUI's linkWithMesh.
  20. Creation of ground

    Hi team, I would like to create a ground in my scene. However I don't want that it was square, is it possible? Thanks!
  21. Hi, I created material, based on Simple material (diffuse map, bump, specular map). Worked fine till point I tried to reuse one material for instance and non instance meshes. Can it be done from technical side? I have mesh that I use to create instances and I have other mesh that just use same material, as soon I add material to non instance mesh my instance meshes disappear on camera movement. Similar as in this tread but my material is not frozen.
  22. I'm stuck with loading my meshes. I'm new to all the 3D and modelling so any thoughts are highly appreciated. Basically I want to extends Babylons default Mesh class called BaseMesh and add a 'load' function to it to get rid of clutter in my scene code. I'm extending this BaseMesh class for each model I have. My BaseMesh class: (Note that all code examples are written in TypeScript) // BaseMesh.ts class BaseMesh /* extends BABLYON.Mesh */ { public readonly BASE_URL: string; // I want these to be static public readonly MODEL_URL: string; // I want these to be static public readonly NAME: string; // I want these to be static public body; /* constructor( scene ) { // I don't know what to do here super( this.NAME //name scene // scene null // parent ? // source ); } */ public load( assetsManager: BABYLON.AssetsManager ) { return assetsManager.addMeshTask( this.NAME + ' task', // name "", this.BASE_URL, this.MODEL_URL ); } public onLoaded( results ) { // I don't know what to do here this.body = results.loadedMeshes[0]; } public update(): void {} }; A model class would looks like this: // Robot.ts class Robot extends BaseMesh { public readonly BASE_URL: string = '/models/'; public readonly MODEL_URL: string = 'robot.babylon'; public readonly NAME: string = 'robotMesh'; public update(): void { this.body.rotation.y += 0.03; } } In my code above I store the loadedMesh from the AssetsManager into this.body. But here is question 1: why is my model already showing on the scene when the meshtask has run? I'm only loading a mesh, I've not put anything about putting it on the scene. Question 2: How do I extend my BaseMesh class from BABLYON.Mesh so that the result (loadedMeshes) of my load function is "the mesh itself" (instead of an attribute this.body). For example this would mean I could change my update function to 'this.rotation.y += 0.03;' and just generally makes more sense. Question 3: I'm really confused about the relationship between my "code" and my "model/.babylon files". Is there any good documentation/tutorials about this? These questions range from: - when is it healthy to split different parts of a model in different files - do I apply textures in my code or do I do that in my .babylon file - do I apply animations in my blender file or do I code them - ... This was a pain to type, if you have any questions please do ask Thank you in advance!
  23. Quick question: Does freezeWorldMatrix need to be called on children meshes to gain full performance benefit, or is freezing a parent mesh enough (I see that the children have different values for isWorldMatrixFrozen, so guessing I need to freeze each child individually, but figured I'd make sure before making a bunch of changes that didn't need to be made) Also: Is there a way to measure how many meshes world matrices are being evaluated in the scene, i.e. something like engine.drawCalls for matrices calculations count?
  24. Hi, i have a question about shadows, is it possible to let a mesh cast shadow on it self? Currently I can make a tree looking like the first picture, but in this case the 3d deep looks not that good. I looking for a solution I can get a tree like the second picture. Thanks for your help Mirco
  25. Hi, I have question about creating meshes based on one prototype. I have multiple meshes, that have same geometry but should have different material (color), idea was to create prototype mesh in 3d max, add bump map and export it. Than I found that Mesh class have source mesh, so I passed my prototype mesh into mesh constructor: PG So far everything was working I could create new meshes and change material for them. But problems started when I tried to create instances from new meshes as all instances where moved to same position: PG But if I make clones from meshes they work: PG Was it designed to be used like that, or I am overusing system Maybe there is better way to achieve same result? prototype -> different meshes -> instances. @Deltakosh some ideas there?