Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Tue Dec 13, 2016 6:53 pm

@X3M Stupid question. How does one parent a mesh to a Camera (or NewCamera)?
I've tried everything.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Thu Dec 15, 2016 2:32 pm

@X3M Issue report.
Image

How to reproduce:
1. Open the "Fog example.capx" B3D example file.
2. Add a (Babylon Matrix) --> "Rotate around world X" action before set LOADED = 1
Image

Same issue exist for the actions circled in red below.
Image

Deprecated perhaps?

Cheers!
Last edited by fuego96 on Thu Feb 09, 2017 4:25 am, edited 3 times in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Thu Dec 15, 2016 3:56 pm

@fuego96 I already reported this issues weeks ago, also happens with the light and other plugins, at least when was reported. I guess he is focusing in other plugins an get all works like have to be or i hope for the 0.6 after the last news.
B
23
S
10
G
3
Posts: 545
Reputation: 4,442

Post » Thu Dec 15, 2016 6:58 pm

matriax wrote:@fuego96 I already reported this issues weeks ago, also happens with the light and other plugins, at least when was reported. I guess he is focusing in other plugins an get all works like have to be or i hope for the 0.6 after the last news.


@matriax From the surface, the names of those Babylon Matrix operations sounds basic enough that anyone who paid for the B3D plugin would likely use them. Surprising they don't work. Maybe they worked once before? I don't know. I can see from the plugins\babylonCamera\runtime.js that it's implemented. However babylon.js (the library) just doesn't accept it (thus the error).

Removing C2 and the B3D plugin from the equation and learning the basics of creating a BabylonJS scene (from http://www.babylonjs-playground.com) purely from JS and rotating a mesh (ie. box.rotate in line 13), i later added a camera.rotate at line 17 and sure enough, it didn't work (Compilation error... camera.rotate is not a function).

Image

Therefore, I'm just going to assume that it's not a B3D issue and that the list of actions (I encircled in red previously) simply be omitted from the "Babylon Matrix" section. Just like how it is with Mesh and NewMesh (they don't have those actions either).

Although strangely enough, the babylon.js library does recognize mesh.rotate (as I tried earlier in line 13).

No biggie. There are workarounds.
Last edited by fuego96 on Thu Feb 09, 2017 4:25 am, edited 1 time in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Thu Dec 15, 2016 7:21 pm

@matriax
@fuego96
Sorry for the late reply, I'm actually rewritting the new plugins because I've found a way to make the C2 events work with the objects as if they were sprites, now you will be able to create new objects using System->Create object , and the new clones will inherit the C2 behaviors .

Now cloning a Mesh is the same as cloning a Sprite.

As for the camera.rotate issue, the lastest version of the library has made some changes, they basically dropped some functions including .rotate( , so I'll need to rewrite those functions.

@matriax About your raycast behavior suggestion, I don't think its doable , however I can make a laser behavior for the camera, which will create a laser parented to the camera and returns at every tick the name of the mesh thats intersecting it.
How about this ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Thu Dec 15, 2016 7:47 pm

X3M wrote: As for the camera.rotate issue, the lastest version of the library has made some changes, they basically dropped some functions including .rotate( , so I'll need to rewrite those functions.


@X3M Don't mind me, i'm here to post issues in a more "hey X3M, i found this..." manner :-) Not really expecting an immediate fix. I have ways to work around (or sacrifice game features).

But you might be interested to know that BJS'es .rotate method still works for meshes. Just not for cameras. And since .cameraRotation already implies BABYLON.Space.LOCAL, the only part you'd need to figure out is WORLD.

Already did this as a workaround for LOCAL an hour ago (for bablylonCamera\runtime.js).
Image

And it works just fine. Here I'm restricting the Camera's pitch as i only want yaw (left and right).
http://crxmedia.com:9180/test/baked2k

BTW, the above is just a baked texture test. The ceiling, floor and all the walls are each 2K textures (2048x2048). Will try 4K just for the heck of it to see if it breaks. Yes, I'm aware that it's not good for mobile (but my target deployment is for a single high-end desktop PC and projected to a very large outdoor display).

Anyway, the usual WASD movement keys apply.
Last edited by fuego96 on Thu Feb 09, 2017 4:26 am, edited 3 times in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Thu Dec 15, 2016 7:55 pm

@fuego96 You are actually rotating the camera on the WORLD axis,
LOCAL axis is only used when you set a parent for your object, since the child inherits the parent rotation, you can rotate it around its LOCAL axis. Example : A door and its hinge.

P.S: that room looks real, I have never used baked lights before, but after seeing this I'm considering doing it because lights look surreal in vray.
I'm a actually hitting the roof with my head or are you locking the vertical tilt ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Thu Dec 15, 2016 8:03 pm

@X3M About using mesh as Sprites. When you say clone you mean duplicate? I know is confusing is simply to be clear :P (Duplicate= Same object name with diferent UID / Clone=Different object Name and UID)

if in the C2 layout i create a NewMesh.Object and i duplicate that object(Not clone) creating various instances, that means all the objects will have the same name but different UID, if in the events i set: On Player collide with Coin=Destroy coin. Will affect to all the coins? Also, i guess will works for duplicate NewMesh.objects in realtime.

And about the mesh name, we still will have to change the mesh name for each duplicate coin to get this works?.


---

About the raycast/laser behaviour, if returns the first mesh that intersects with the laser/raycast in front the camera, being "front the camera" the center of the render, yes, i guess will work. If is possible set an "offset" will be great, because if we add an interface in the bottom/top, the center of the aim can change, i don't know if i'm explaining well, BTW, for the moment that have to works thanks!.
B
23
S
10
G
3
Posts: 545
Reputation: 4,442

Post » Thu Dec 15, 2016 8:05 pm

X3M wrote:@fuego96 You are actually rotating the camera on the WORLD axis,
LOCAL axis is only used when you set a parent for your object, since the child inherits the parent rotation, you can rotate it around its LOCAL axis. Example : A door and its hinge.

I see. Well, at least it didn't explode...

X3M wrote:I'm a actually hitting the roof with my head or are you locking the vertical tilt ?

Yes, i'm locking the "vertical tilt" (what is commonly referred to as the "pitch", from the pitch, roll and yaw standard). But wait, you're hitting the ceiling? You mean it's not behaving like this (short video capture)? Are you sure the Spacebar isn't stuck? (it still allows strafe up).
Last edited by fuego96 on Tue Feb 14, 2017 6:21 pm, edited 4 times in total.
I don't need a better iPhone, I need to be better.
B
25
S
10
G
20
Posts: 68
Reputation: 11,888

Post » Thu Dec 15, 2016 8:08 pm

@matriax Correct, actually the name will not be accounted for anymore, but I will leave it there just to distinguish between your meshes on the layout. But it will not be used anymore by the engine.

No, since you won't need the mesh name anymore. From now on (This applies only for the NewXXX plugins) you will access things with Pick by UID just like Sprites.

@fuego96 If you leave the tab and return, the locking will slightly go loose
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests