Quantcast
Viewing all 388 articles
Browse latest View live

Beautiful effects


Can't export animation with alpha change from blender

 

the animation in blender has change of position, rotation, scale, and alpha.

 

but i see in the .babylon file only position, rotation, scale but no alpha.

 

 

Is it normal? or who can tell me how to make alpha change animation in blender and export?

 

convert whole scene to ToFlatShadedMesh

Hey guys, I have made a basic scene in blender with some lights and textures.

 

I have set the shading to FLAT in blender however the scene in babylonjs is smooth, I know for individual meshes I can use the convertToFlatShadedMesh() function but that doesn't seem to work on a scene object. 

 

My question is, is there a way to make the whole scene use flat shading? I don't want the scene to be smooth shaded and I cant find a way to set this in the scene api.

Fix altitude when FreeCamera moves

Guys, is there any option to fix altitude (Y-axis position) of FreeCamera when I move it? I wanna change Y position only manualy by another keys.

How to use DynamicTexture

Hi guys,

 

I have this type of menu split into section (buttons). I want insert (line 111) a text in each button using a DynamicTexture but, as you can see, the text have a irregularity in the corner (i guess it's due by the ribbon's triangulation).
There are other ways to enter text in a Mesh, perhaps with the possibility of indicating the inclination?
 
Here my code (it's just a draft  Image may be NSFW.
Clik here to view.
:D
)

Thanks to all.

 

Can i take canvas (babylon) screen shot and save it to variable?

hello

Can i take canvas (babylon) screen shot and save it to variable to send it to serwer like byte[]?

Blog about you!

Is it possible to export text objects from blender?

Hello everyone!

I've tried to export blender scene with some text objects to Babylon.js, but text didn't get exported. So is it actually possible to export text objects from Blender into .babylon file?


Draw rectangle and mesh selection

Hi!

 

I'm trying to create unit (mesh) selection as it is in various strategy games(AoE, CnC (attached image) ...).

After some exploring, I've came to the following, but there are a couple of steps I don't know how to do:

 

1. Hook to events (OK - trivial)

2. Draw lines using BABYLON.Mesh.CreateLines - at what position? Set LineMesh parent to camera? How to translate mouse position (scene.pointerX and Y) to world coordinates? Just draw rectangle and and set transformation matrix to identity (4x4)? Canvas 2d and 3d context can't be used together.

3. Once that is known, visible meshes are selected with octree (frustum plane is created and used for selection via octree.select method). But frustum plane can be very small and very close, or very big and far away (but this it's probably solved at step 2)

 

I haven't really got to point 3. (got stuck at 2) so it's only my speculation.

I'm open to suggestions if there are any better options Image may be NSFW.
Clik here to view.
:)
.

 

Explanation for attached image for non strategy game players:

Green rectangle was drawn simply clicking in one corner and dragging. It's always orthogonal to camera view and at the same position (also based on camera) even if camera is moved or rotated. Its rendered above everything and every unit inside is selected.

 

Thanks!

How to setEnabled of lines in babylon?

rigth to write a motion blur shader

Hi guys !

 

    I need to write a motion blur shader, i allready got the logic.... flipping twos buffers etc .... but GLSL is a bitch and developping with babylon with thoses "bla ..." + etc is pain ....

    I have the idea... if some of you can direct me correctly, it would be cool Image may be NSFW.
Clik here to view.
:)

 

Thanks in advance Image may be NSFW.
Clik here to view.
;)

transparency of shaderMatetrial is not working.

I followed the render to texture discussion with the example of depth buffer. And I set the alpha channel in the fragment shader to zero. But the spheres the plane is not transparent at all. I have set needAlphaBlending to true.

 

Am I missing anything?

 

http://www.babylonjs-playground.com/#EEOWP#1

FreeCam not working

Hello everybody
I'm trying to make a 3D model explorable, but I'm having problems with the free cam and do not understand what is wrong.
The scene works with a ArcRorateCamera but when I try to change it in a FreeCam it gives me error...

can you help me?

 

thanks

Simone

Using sprites as buttons to do different things.

Hi guys! I'm pretty new to java script and babylon.

 

I want to use sprites that makes different result for my scene.

 

so i tried to do coding like below

 

 

 //Create a manager for the Dinning's sprite animation
    var spriteDinning = new BABYLON.SpriteManager("icon_Dinning", "textures/dining.png", 1, 200, scene);

    var Dinning = new BABYLON.Sprite("Dinning", spriteDinning);
    Dinning.position = new BABYLON.Vector3(-10.11, 6.8, 13.2);
    Dinning.isPickable = true;
    Dinning.size = 2;
    
    var spriteSleeping = new BABYLON.SpriteManager("icon_Sleeping", "textures/beds.png", 1, 200, scene);

    var Sleeping = new BABYLON.Sprite("Sleeping", spriteSleeping);
    Sleeping.position = new BABYLON.Vector3(10.11, 6.8, 13.2);
    Sleeping.isPickable = true;
    Sleeping.size = 2;

    scene.onPointerDown = function (evt) {
        if (Dinning.hit) {
            Dinning.position = new BABYLON.Vector3(0,0,0);
        }
        if (Sleeping.hit) {
            Sleeping.position = new BABYLON.Vector3(0, 5,0);
        }
    };
 
But it seems not to be working Image may be NSFW.
Clik here to view.
:(
How sad is this....
 
Anybody can help me?

Conditional input of texture into a shader

Sometimes the shader I am creating will be given an image file to use as a texture sampler and sometimes it will not. 

 

In the shader when the image file is given I need the line

uniform sampler2D refTexture;

and in the main function a line along the lines of

float x = 0.5 * texture2D(refSampler, uv).rgb.x;

and when no image file is given then

float x = 0.5 * position.x

From looking at the code in the samplers in the materialsLibrary I see there are some conditions on the uniforms such as

#if defined(SPOTLIGHT0) || defined(DIRLIGHT0)
varying vec4 vPositionFromLight0;
uniform sampler2D shadowSampler0;
#else
uniform samplerCube shadowSampler0;
#endif

1. Is there a condition I can use for

#if ..................
uniform sampler2D refTexture;
#endif

2. Is there a conditional statement within the main function I can use for

IF texture loaded
    float x = 0.5 * texture2D(refSampler, uv).rgb.x;
ELSE
    float x = 0.5 * position.x
ENDIF

 


AbstractMesh.billboardMode strange behavior

Xbox One supporting WebGL and Babylon.js!

Hi 3D gurus,

 

 Starting yesterday, the Xbox One is now supporting WebGL thanks to the new system update.

 

 I've written a small article with 2 videos showcasing that: http://blogs.msdn.com/b/davrous/archive/2015/11/13/debugging-your-html5-on-xbox-one-ms-edge-with-the-xbox-windows-store-app-and-vorlon-js.aspx

 

 You'll see the Mansion Babylon.js demo running fine with Web Audio and Gamepad support! Conclusion: everything we're currently building for the other web platforms (PC, tablets and smartphones) is already running fine on Xbox One.

 

 I'm proud of the architecture of Babylon.js that handle any new platform like a charm. Image may be NSFW.
Clik here to view.
:)
Enjoy!

 

Cheers,

 

David

 

Share simples effects !

Hi all !

 

     There is a simple effect (i mean all is BabaylonJS natives functions)

 

     Simple Skybox + Mesh loading (80400 vertices +60 objects) + Normal mapping + Cubic environment mapping.

 

     Enjoy : http://www.synergy-development.fr/cubix/

Image may be NSFW.
Clik here to view.
cubix.png

CreateTiledGround Submeshes

Hi am having some problems with the createTiledGround function.

 

I followed this tutorial and have a tilted ground but I will like to detect a mesh colliding with one of the tiles but when I try and get the boundingInfo for the submeshes its allways the same as the Main Mesh.

 

using the showSubMesesBoundingBox shows me all the bounding boxes

 

 

 http://www.babylonjs-playground.com/#1XBLWB#83

 

 

but am struggling to do the collision on a submesh by submesh bases

 

 

Any help would be great

Beginner questions

Hello, i am totally new to the Babylon.js scripting framework. 

 

My first question is, how can i change the value of alpha for an material on klick event.

 

samplematerial.alpha = 0.3; seems to be a float , however, there is also new BABYLON.Color3 and new BABYLON.Color4 which can be changed on actionmanager code.

Color3 is RGB and Color4 is RGB Alpha. 

 

So how can i change the alpha value ? Should i use color4 ? 

 

Here is what i have so far :

 

http://www.babylonjs-playground.com/#1ST0I

 

Also, i can´t figure out which of this code seqments do what or how they are named like. Like this things that are inside "example".

I have to begin somewhere so i hope my first question isn´t that bad.

 

Greetings and thanks in Advance 

Viewing all 388 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>