Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Sat Jan 14, 2017 6:35 pm

@matriax Glad you got it working, are you making a minecraft like game ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Sat Jan 14, 2017 6:44 pm

@X3M Not really, first the idea is do some kind of template/Engine for FPS, with all the basic parameters added and all working with camera, fog, gravity,etc.. to be easy to use.

After that will see, but yes for a first try some lowpoly/res game in 8bits with C2 shaders i think can look really cool. Something like Cube Rampage on all are basic shapes but with effects and other techniques give it a cool touch. For that the thing about deactivate anisoptric filtering, nearest instead of bilinear sampling mode,etc... to have sharp pixels.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sat Jan 14, 2017 9:00 pm

Trying to achieve another thing that i though was more easy...

If you aim the sky and go forward(W) you can fly or go up, in the same way if you look at the floor and go backwards(S) you can fly or go up.

I tried to do some fixes but nothing worked. I simply want that when i press W to go forward the camera moves forward over the floor without matter if is aiming the sky. And if i look the floor and press S i want to go backwars no UP.

I guess maybe the set controls to camera is not what i need here, so i tried with "set position", "translate by" and "translate by ease" but can't get it to move correctly. The one that detect colisions is the "translate by ease", but i can't figure how to set that when i press the key goes to the direction in front the camera not the world axis. I tried the FrontCamera expresions and others like Camera.DirectionX but always is a mess. Also tried that when i press W fix the y position to avoid flying but nothing working 100% fine.

Is there any solution for this @X3M ? I willleave at the moment, I'm going to test other things like jump, crouch,etc....
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sat Jan 14, 2017 9:12 pm

The camera is meant to be moving freely if you don't activate physics, hence the name Freecamera. These are things that are normal and that were made by the BabylonJS devs.

A Freecamera goes forward when you press W and backwards if you press S, it takes under consideration the rotation of the player.
So if you wanna make your own settings, then I recommend you change to Targetcamera instead of Freecamera, that way the camera behavior won't interfere with your settings and controls.
On keypress W:
Set camera position to (Camera.FrontXPos(1),Camera.FrontYPos(1),Camera.FrontZPos(1))
On keypress S:
Set camera position to (Camera.FrontXPos(-1),Camera.FrontYPos(-1),Camera.FrontZPos(-1))
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Sat Jan 14, 2017 9:31 pm

I can't set a TargetCamera when i do get this error:

Image

I tried to set the targetCamera in your FPS to see if was my code and the same error :( .

BTW, i tried what you said on FreeCamera and yes when i press a key the camera moves in that direction but in a weird way, i guess because is a FreeCamera.Maybe with that i can fix it for the freeCamera, i will try tomorrow.

Edit: If you say takes the camera rotation of the player in consideration maybe when we press forward(W) on Freecamera is add some (-Y rotation) coordinates or similar to respect the controls? More things to try.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sun Jan 15, 2017 10:51 am

I was testing the collisions to do when camera or another object collides with other = destroy mesh but i was unable to get it, or not works or i get an error, this one:

When i try to destroy a NewMesh (No matter how)
Image
(For example on press X > destroy NewMesh)

When i try On NewMesh intersects with an OBJ-Mesh, or OBJ-Mesh intersects with another OBJ-Mesh nothing happens, The New/OBJ Mesh stops in their mass center, so detects the collision but the mesh is not destroyed.

What i'm missing?

I saw your examples but the Platformer and the Racer have C2 collisions, and the FPS the unique collision is the camera with a wall but without interact/destroy that mesh.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sun Jan 15, 2017 2:25 pm

Damn more errors :(

Image

Image

OBJ mesh on intersect with a point and giving the other OBJ mesh X/Y/Z position (MeshPosX,MeshPosY,MeshPosZ). Also trying to get the center point of the mesh or absolute position,etc...

I'm trying all the possible ways that comes to my mind to when an object collides with other(Using babylon events) and or not works or get a new error.

I'm going to leave the collisions and try again the movement thing to see if i can fix the FreeCamera.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sun Jan 15, 2017 3:40 pm

@matriax Does your OBJ model have physics behavior ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Sun Jan 15, 2017 4:26 pm

@X3M Tried both objects or only one of them with the babylon3D physics behaviour added and without physics, always with the same result and other errors:

Image

They need the Physics behaviour to detect the collision and interact?

Other tests:
If i press X and set destroy NewMesh get an error. On OBJ-MESH the mesh is destroyed without problems on press a key. On mesh picked with the mouse the NewMesh object is destroyed on OBJ-Mesh no.
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

Post » Sun Jan 15, 2017 4:36 pm

@X3M Edit, no matter the physics behaviour, seems to destroy the mesh only works when is the first in the condition not the one who receive the collision. ¿?

I mean:

Image

This works, but if i try to destroy the other get the error.

I always tried to destroy the second mesh. i mean, when a bullet collides with the enemy > Destroy enemy. But only works if i set If enemy collides with a bullet > Destroy enemy. Is a bit weird, but now is working.

In C2 the collision works in Both ways. In fact in C2 also you can set: If Mesh1 collides with Mes2 > Destroy Mesh3.. But in babylon only works with Mesh1.

-

EDIT: In case Of collision of Mesh1 and Mesh2 if i try to destroy a Mesh3 this is the error(Same for OBJ-Mesh):

Image
B
23
S
10
G
3
Posts: 538
Reputation: 4,426

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest