Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Mon Dec 12, 2016 7:55 pm

Bought this Plugin. It seems really cool and powerful, great work! : )
However, I encountered this problem....i imported a obj mesh and i applied a diffuse texture...when i launch the preview with NW.js it gives me this error "cannot set property 'diffuseTexture' of undefined babylonOBJ_plugin.js, line 1135 (col 27)"....only when i apply texture....i have version 240 and the last nw.JS...
B
25
S
7
Posts: 8
Reputation: 1,441

Post » Mon Dec 12, 2016 8:06 pm

vurzu wrote:Bought this Plugin. It seems really cool and powerful, great work! : )
However, I encountered this problem....i imported a obj mesh and i applied a diffuse texture...when i launch the preview with NW.js it gives me this error "cannot set property 'diffuseTexture' of undefined babylonOBJ_plugin.js, line 1135 (col 27)"....only when i apply texture....i have version 240 and the last nw.JS...


You dont need to apply anything to the .obj file, it already comes with a .mtl file which holds all information of diffuse textures.
So you only have to import : the .obj , .mtl and images files
The library will take care of everything.

Here is an example of a car model that I've downloaded from the Internet :
Image
Image


Most 3D models websites when it comes to free stuff do not provide good quality obj models, and they often can be missing some image files, so here are some good websites where you can download well made obj files :
1- https://www.cgtrader.com
2- https://www.models-resource.com
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Mon Dec 12, 2016 8:46 pm

Ok, the obj file is a 3d map i made, i'll import the corresponding mtl file and texture in the library. Thanks for the quick reply and the support!
B
25
S
7
Posts: 8
Reputation: 1,441

Post » Mon Dec 12, 2016 11:35 pm

X3M wrote:@matriax I'll figure out a way how to make a bullet behavior
@MATAGUIRIS You can already use raycasting
Image

They are used as expressions to either return the mesh name which intersects with the ray, or the x y z position of the intersaction point between the ray and a mesh.

Here in the example, A ray is casted downwards from 0,20,0.
It is casted vertically because I chose the Y axis (0,1,0), its downwards because its 1 and not -1, if I chose -1 the ray will go upwards.

So if there is a mesh under the position 0,20,0. The game will tell you its name and the contact point.

@matriax Yep thing will be done the right way in 0.6, I just need time to make everything set.
Now work rate is at 200% and things are done quicker since I switched to VS code that gives codehinting (At least for Typescript) , (Props to @fuego96 for recommending me the software)


Can you add an example to throw a ray in front of where the free camera is looking?

I can not make it work :oops:
B
57
S
20
G
10
Posts: 99
Reputation: 9,040

Post » Tue Dec 13, 2016 1:21 am

Image

Here is a capx which explains two methods , one using Raycast and the other using Intersection.

You know whats cool? That you are able to get the exact contact point with Raycasting, this will come useful when I will implement Decals in the future. You know, bullet-holes and stuff...
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Tue Dec 13, 2016 7:31 am

@x3m Mmm not works for me, tested on NW.JS and browsers and this is how looks:
Image

The laser is always in that position. What can be?

Also in my FPS tests to launch bullets happens the same, the bullets are launched to the left instead in front the camera.

In this .capx i not edit nothing, simply open and run and this is the result. I tried also desactivate one of the methods but the same none works.
B
25
S
10
G
3
Posts: 577
Reputation: 4,556

Post » Tue Dec 13, 2016 9:12 am

I have the same problem as @Matriax.
I get the cross line XD
B
57
S
20
G
10
Posts: 99
Reputation: 9,040

Post » Tue Dec 13, 2016 9:27 am

@X3M, Confirming same raycast issue as with @MATAGUIRIS and @Matriax
I don't need a better iPhone, I need to be better.
B
26
S
10
G
20
Posts: 68
Reputation: 11,913

Post » Tue Dec 13, 2016 10:47 am

Image
Change it to 1000,0.5,0.5

Anyway you should get the point how they work
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Tue Dec 13, 2016 11:06 am

X3M wrote:Image
Change it to 1000,0.5,0.5


Changed the "direction" of the laser, but, it appears the laser mesh'es Y position was simply too low. Changing the laser mesh position to (0,50,0) worked for me (just how did it ever work for you???)

And on to a different subject, by the way, can you implement ShaderMaterial ? I can't wait to use some from Shadertoy :-)
I don't need a better iPhone, I need to be better.
B
26
S
10
G
20
Posts: 68
Reputation: 11,913

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests