# Wemperer2

Members

18

• Rank
Member

## Recent Profile Visitors

479 profile views

1. ## CanonJS Physics: Pass through certain objects

Sorry to bother once again but I have to come back to my original question. How do I check the rotation of an object? The rotationquartions isn't working for me, I just do not understand the math (im not a math person). I need things in radiant/degrees. When I use: player.rotate(BABYLON.Axis.Y, BABYLON.Tools.ToRadians(1), BABYLON.Space.WORLD) I need to figure out what property of the mesh this is rotating so I can convert it to Radians. If I attempt to convert rotation.Quartions I get NaN. player.rotation always returns 0, 0, 0. I I swear when I figure this out I'm writing some Idiots Guide level tutorials...
2. ## CanonJS Physics: Pass through certain objects

Is there a way to use the filtergroups with imposters? I have the physics working and collision is detected using imposters and it seems using CANNON body objects is a bit more complex. (creating a world, adding objects to world etc) My rotation problem is solved. Thanks for the help I really appreciate it.
3. ## Space Shader / BG / ClearColor

I'm making a space game and I'm wondering what would be a good way to simulate distant stars. My initial thought was to randomly generate white specks super far out but that doesn't seem very respectful of resources. Is there a way to simulate it with clearColor or perhaps a repeated PNG?
4. ## CanonJS Physics: Pass through certain objects

Thanks for the reply I am using the imposter system. I can't figure out how to attach a Body to a babylon mesh....
5. ## FollowCamera Fixed Angle/Rotation

Ok. Couldn't figure out how to delete this post so anyone who happens to fall upon it in the future... You're using the wrong type of camera. Use the arcRotate camera, position it, and set the target to your character. var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 100, character, scene); The cam will stay locked on, you just need to get the rotation right.
6. ## FollowCamera Fixed Angle/Rotation

I have an issue where I am using the followCamera in a top down view (think original grand theft auto). It works fine except when I apply impulse to my character/mesh/imposter to where the character moves backwards, the camera rotates a full 180 degrees. I want the camera to stay in the position so that it never rotates. Meaning, the north portion of the map will always be north, regardless of the direction of the character/mesh/imposter the camera is following in the top down view.
7. ## CanonJS Physics: Pass through certain objects

I'm trying to figure out how to make a projectile pass THROUGH certain objects while making contact with others. I'm also having the issue where my projectile is created dynamically so I can't stick in a event listener in the registerBeforeRender() function because they don't exist at the time that function is called. Basically, I want to be able to shoot enemies in my game, while not shooting allies. I'm also having an issue where I can't seem to get rotation coordinates of my object. I can get the coordinates but when I check mesh.rotation() I always see 0, 0, 0 even when I change it with a event listener...
8. ## Question regarding animation and rendering

I intend to import some models and animations I created in Blender but I have no idea how games incorporate animations. Since I plan on making a mobile game, I'm concerned complex models on top of intricate animations will ruin my project. I understand how 3D video animation works in regards to rendering the animation (taking hundreds of thousands of pictures) but how does this work in games? Does everything that moves pre-rendered and just played upon certain triggers or does the cpu/gpu calculate/manipulate meshes on certain triggers? Sorry if this doesn't make sense but I have the feeling I'm going to end up with a bunch of animation files for each model, for each type of movement and depending on how large these files are, may render a mobile game I want to make impossible.
9. ## Import Scene Error: Blender

@gryff Holy cow man you went way above and beyond there! I really appreciate it. I'll be playing with this for awhile. I'm new to blender so that's why there is alot of stuff missing with the Guy. I just waned to practice creating a model and getting it into Babylon. What exactly does this mean? The components of the mesh should be all in the same layer? What are origins/transformations?
10. ## Import Scene Error: Blender

I'm so sorry, late night. characterv2_17_7.blend
11. ## Import Scene Error: Blender

Thanks to you both. The code looks WAY cleaner and works as far as loading the stage but my Guy still doesn't get imported. It's back to the loading loop and it is def with the import of the guy line. Is it because he has an armature? I couldn't find (I don't think its actually there) the 'export selected only' option in blender but I am kinda guessing the import is failing because 'guy' is an entire scene and I'm back to my multiple cameras issue. Am I blind or is that checkbox missing or am I exporting wrong? Here is Guy: [snip]
12. ## Import Scene Error: Blender

Thank you, that was indeed the problem. Now I'm having an issue importing meshes. It seems to 'work' but I don't see the supposedly imported meshes. if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); engine.enableOfflineSupport = false; BABYLON.SceneLoader.Load("", "stage.babylon", engine, function (newScene) { newScene.executeWhenReady(function () { var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 0, BABYLON.Vector3.Zero(), newScene); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), newScene); camera.setPosition(new BABYLON.Vector3(-10, 50, -50)); camera.attachControl(canvas, false); light.intensity = 1.2; engine.runRenderLoop(function() { newScene.render(); }); BABYLON.SceneLoader.ImportMesh("guy", "", "guy.babylon", newScene, function (newMeshes, particleSystems) { }); }); }, function (progress) { // To do: give progress feedback to user }); }
13. ## Import Scene Error: Blender

Hello. I'm having trouble importing a scene from blender. The screen is and enless loading loop and I'm getting this error in console: Uncaught TypeError: e.UniversalCamera is not a constructor if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); engine.enableOfflineSupport = false; BABYLON.SceneLoader.Load("", "guy.babylon", engine, function (newScene) { var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 0, BABYLON.Vector3.Zero(), scene); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); scene.clearColor = new BABYLON.Color3(0, 1, 0); camera.setPosition(new BABYLON.Vector3(-10, 50, -50)); camera.attachControl(canvas, false); light.intensity = .5; // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); }
14. ## Bug: Deleting Layer

There is a strange bug I'm experiencing where I set a foreground layer var foreground = new BABYLON.Layer("back0", "images/parchmentMap.jpg", scene, false, new BABYLON.Color4(1, 0, 0, 1)); then when I delete it with dispose(), all my sprites turn to the image used in the layer (but without the color). While i'm here, How would I go about getting my sprites to appear on top of this foreground layer? I would use a background but I want to cover everything on the screen temporarily and display the sprites on top of the foreground image without deleting the scene.

Thank you!!