• Content Count

  • Joined

  • Last visited

About Thark

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. What about the use of PIXI.WebGLRenderer, PIXI.autoDetectRenderer and PIXI.CanvasRenderer? In the getting started tutorial ( ) they use PIXI.autoDetectRenderer but in the demos ( ) they all use PIXI.Application. Whats the difference between an Application and a WebGLRenderer or CanvasRenderer?
  2. This is not completely clear to me. My .babylon files are just meshes I created in blender, I didn't think this was for "complete" scenes. What is used to just import a mesh/model? Do I make make all my meshes in 1 blender project that I then export to a .babylonjs file? I thought each mesh/model had its own blender project that was then exported and imported through the AssetsManager in my scene code. I'm like really confused now about all of this and how I should do it haha What is considered best practice?
  3. Thanks for the reply @adam! That does kind of answers question 1. I could use isVisible = false to hide the mesh when loaded. public onLoaded( results ) { this.body = results.loadedMeshes[0]; this.body.isVisible = false; } But that's still very strange and inconsistent behaviour. I'm expecting my vertices, shapes, ... and all that to be returned and not an actual instance of a mesh. It doesn't do that for any other tasks (like loading a sprite). Does this also not affect performance? If I load in a bunch of meshes this way, but 90% of them are 'invisible' would I get the same performance as if I only load the 10% that are visible? Questions 2 and 3 are also still bugging me out.
  4. I see what you're going with but "Robot" is just an example here. Calling it RobotMesh would've maybe been better to make my point.
  5. 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!
  6. Hey everyone I just have two simple question I cannot find an answer too. First Question: The SpriteManager needs a capacity parameter, but why does it need this? Why can I not change this during runtime? What does it actually do (in the background) (except for just not showing any sprites that exceed the capacity)? Does it hurt performance at all if I just put a 'crazy' high number? Can the manager not just +1 the capacity by itself in the background whenever an instance of the sprite is created? It just seems so odd that I have to give it a number and I feel like I'm missing something here. My second question is how to exactly use the AssetsManager for sprites. The documentation gives this example: var imageTask = assetsManager.addImageTask("image task", "img.jpg"); imageTask.onSuccess = function(task) { console.log(task.image.width); } But that doesn't explain how to use it with a Sprite since the task returns an image, and a SpriteManager only requires an image url. Thank you in advance!