14 September 2016 16:04

Hi and thanks for your helping.

So far, I managed to calculate an intersection between a 3D Point and the screen

–> use m_cam.project_point()… , it's OK.

I managed to calculate an intersection between a 2D click with a plan in the 3D space

–> use parametric line, m_cam.calc_ray, m_math.line_pline_intersect …, it's OK.

Now,

I say it's works on Unity with : Physics.Raycast( transform.position, -Vector3.up,

I want, every time I move my player, calculate the distance between my player and the fake floor not-rendering. If this distance is higher or lower than my constant (1.7m), I modify the Y value of my player's transform to my constant. Like this, the player is all the time "standing".

Create a fake floor like this allows me to create an other floor to smooth the steps of a staircase for example.

In this example, I don't use the pline/plane intersection method because my fake floor is not a plane.

To overcome my problem, I thought to use physics with my player and my floor but I'm not really convinced to use physics. if it's possible, I would rather do without.

So far, I managed to calculate an intersection between a 3D Point and the screen

–> use m_cam.project_point()… , it's OK.

I managed to calculate an intersection between a 2D click with a plan in the 3D space

–> use parametric line, m_cam.calc_ray, m_math.line_pline_intersect …, it's OK.

Now,

**I want to calculate an intersection between a parametric line and an object**but I dont't know how it works in Blend4Web. It is possible ?I say it's works on Unity with : Physics.Raycast( transform.position, -Vector3.up,

**out hit**, 50, LayerMask.GetMask("myFloor") )*To illustrate :*I want, every time I move my player, calculate the distance between my player and the fake floor not-rendering. If this distance is higher or lower than my constant (1.7m), I modify the Y value of my player's transform to my constant. Like this, the player is all the time "standing".

Create a fake floor like this allows me to create an other floor to smooth the steps of a staircase for example.

*My problem :*In this example, I don't use the pline/plane intersection method because my fake floor is not a plane.

*An other possibilty ?*To overcome my problem, I thought to use physics with my player and my floor but I'm not really convinced to use physics. if it's possible, I would rather do without.

I'm not crazy ! My reality is just different than yours.