• Content Count

  • Joined

  • Last visited

About kaitek666

  • Rank
  • Birthday 08/04/1998

Contact Methods

  • Website URL
  • Twitter
  • Skype

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1217 profile views
  1. @V!nc3r the problem is, these squares are meshes. It would be performance-heavy and hard to change (textures, etc. I know you can, but I don't enjoy manipulating models..) Correct me if I'm wrong, you can bake lighting only in outside software, yes? I need other tiles to be lit by this tile. I don't think this is the way to go.
  2. Not realtime. I will need it to be updated from time to time when environment changes, but not in real time
  3. Thanks for your answers @gryff & @Wingnut! Emissive texture/color were really helpful. But still, I cannot achieve what I wanted to @Wingnut, I tried making a mesh with a square above the tile, but I've got ~20 of them in my small map, and performance drops really hard on it. Shadows are expensive. Wish I could find a way to push to shadow render list my whole scene. I cannot, I think. @gryff, I could add some meshes to render list easily, but squares around my square are the same size, resulting in a weird, unnatural lighting around it. I appreciate your ideas, but I don't know if I'm going to find a satisfying answer for me. Sorry Thanks a lot! Kajtek
  4. Miss it too.. Where am I going to say Good Morning to everyone now?!
  5. Hello! I have a square surface. I wanted it to shine. Other objects around it needed to get lit by it, but.. here's a problem. Light is always round, wherever I place it. I know why, because I understand how lighting works. Here's an image showing what I mean: Is there any way to make a light emitting from a mesh, not from a point? ps. My game is in 3D. Dunno if it's important. Cheers! Kajtek
  6. I'm really sorry I haven't been able to help you. I had some trouble irl, and now I'm back into game dev I'll message you ASAP Oh dear, that was supposed to be a private massage to @Wingnut! I cannot delete this now
  7. @Wingnut about touch devices, I have a tablet with Windows 10. If you want my help, I can help you. Onda V80 Plus
  8. Thanks a lot, @Wingnut! I still needed to understand UVs better, because of displacements I couldn't get along with. I will read and (if I'm brave and clever enough ) reply to this thread. Cheers, buddy!
  9. Thanks @Deltakosh! I didn't know that! My code is fine now, I put everything in one forEach(). It's working!
  10. Hey! It's me again Since I started using BJS as my game engine, I've came across some problems I couldn't understand, but animations are the hardest for me. Using this.tutorial I created an animation on my loaded model with several meshes. When I want to run my animation (here's a default one, from tutorial) only one (first) mesh is being animated. Am I doing something wrong? RockRaider.prototype.walk = function() { var animationBox = new BABYLON.Animation("myAnimation", "scaling.x", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); var keys = []; keys.push({ frame: 0, value: 1 }); keys.push({ frame: 20, value: 0.2 }); keys.push({ frame: 100, value: 1 }); animationBox.setKeys(keys); this.raider.forEach(function (mesh) { mesh.animations.push(animationBox); }); this.raider.forEach(function (mesh) { scene.beginAnimation(mesh, 0, 100, true); }); } Please note: Putting them in separate forEach wasn't necessary. Firing them at once does not solve the problem. I tried this solution as well, but it didn't do the trick: animationBox.setKeys(keys); this.raider.forEach(function (mesh) { mesh.animations.push(animationBox); // scene.beginAnimation(mesh, 0, 100, true); }); for(i=0; i<this.raider.length; i++){ scene.beginAnimation(this.raider[i],0,100,true); } Cheers! Kajtek
  11. Found the solution. Thanks @adam for code sample, that helped me out as well. What was the problem? Scene loader sequence. Mid-loading of my model, engine was running a RenderLoop, causing half of model load, and the second half to load in.. a different way. I'm using this code temporary: setTimeout(function() { var scene = createScene(); setTimeout(function() { engine.runRenderLoop(function () { scene.render(); }); }, 1500); }, 2000); Which is really nasty! I need to fix execute sequence. Thanks a lot guys! Kajtek
  12. Hey! I created another topic lately, but my problem changed a lot. I have a rockraider.babylon model (included in attachments). I created it and it's being displayed. Everything's OK. class RockRaider { constructor(xpos,zpos) { var raider; this.ready = false; BABYLON.SceneLoader.ImportMesh("", "CanvasRR0/", "rockraider.babylon", scene, function (newMeshes){ console.log("Number of meshes... " + newMeshes.length); newMeshes.forEach(function(mesh){ mesh.scaling.x = mesh.scaling.y = mesh.scaling.z = 1.3; }); raider = newMeshes; }); setTimeout(() => { this.raider = raider; this.ready = true; }, 1000); } moveTo() { this.raider.forEach(function(mesh){ mesh.__tak = true; mesh.position.x = 10; }); } } (I'm sorry for no syntax. I cannot set it. Here's a pastebin version with highlighted syntax if you wish) Then, when I want to use function rockraider.moveTo(), via developer console, (which is supposed to place all meshes in x = 10), only a few of them are being moved. Left: Original meshes. Right: Translated meshes to x=0 My model has 9 meshes. Here's an image showing which meshes has been moved and which hasn't: This is a list of meshes taken from Blender. But hey, there's more! To debug, I gave each mesh a __tak variable and set it to true. I can see this value in every mesh of this model. Even if I use rockraider.raider[0].dispose(); and then rockraider.raider[1].dispose(); etc., The elements are actually being disposed. They get removed. But not all of them!! Even if some meshes don't even exist in console after disposing them, They still appear on screen. For example, when I type in in developer console: rockraider.raider.forEach(function(mesh){ mesh.dispose(); }); This is what I get: Some of the meshes disappeared, but the rest are still on the screen. How and why? Is this a bug? Is this fault of engine, or model? In attachments I included rockraider.babylon. I need explanations, ideas, etc. I'm using BJS v2.5 stable (latest) and Exporter for Blender v5.2.0. rockraider.babylon
  13. Tried everything, really! The solution I found was to convert .obj to .babylon and import it using SceneLoader.ImportMesh like you did in example above. Thanks for giving me idea to Import mesh instead of giving it to loader Much thanks, @Wingnut!!
  14. Hey. Here's my class: var rockraider; // [...] class RockRaider { constructor(xpos,zpos) { var raider; this.xpos = xpos; this.zpos = zpos; /*this.rotation = rotation;*/ raider = loader.addMeshTask("build", "", "CanvasRR0/", "rockraider.obj"); raider.onSuccess = function(t) { t.loadedMeshes.forEach(function(m) { m.position.x = xpos; //-75 m.position.z = zpos; //-50 m.rotation.y = Math.PI/2; //dev m.rotation.x = 0; m.scaling = new BABYLON.Vector3(2,2,2); }); }; this.raider = raider; setTimeout(function() { raider.loadedMeshes.forEach(function(m) { m.material.emissiveColor = new BABYLON.Color3(.1, .1, .1); }); }, 3000); } moveTo() { this.raider.loadedMeshes.forEach(function(m) { m.position.x = 100; }); } } //dev rockraider = new RockRaider(125,200); And here's my question: Why doesn't my model move when I call function rockraider.moveTo();? Instead, only one element of it moves. I used a forEach(). In first case (in above code, under 3000ms timeout) it worked, but in second it didn't. Why? Thanks Kajtek