You are not logged in.

jordi

Professional

  • "jordi" started this thread

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

1

Friday, April 8th 2022, 1:33pm

Custom everpano raycaster implementations

Hi,

You can make usage of the everpano raycaster for your own implementations.

everpano raycaster

The navigator plugin provides those 2 public functions to get information about 3D positions of your model

plugin[navigator].ev_mousetomesh
plugin[navigator].ev_raytomesh

** Of course a requirement is that the project is done using everpano 3D, it won't be valid otherwise.

ev_mousetomesh : transform the mouse position into a 3d position of the mesh
ev_raytomesh : transform a ray which has origin vector and direction vector into a 3d position of the mesh

Demo of usage :

<events name="everpano_raycaster" keep="true"  
onclick="plugin[navigator].ev_mousetomesh(get(mouse.x),get(mouse.y),my_d,my_x,my_y,my_z,my_nx,my_ny,my_nz,my_rx,my_ry,my_rz); 
    debug('distance : ',my_d); 
    debug('position'); 
    debug('x : ',my_x); 
    debug('y : ',my_y); 
    debug('z : ',my_z); 
    debug('normals'); 
    debug('nx : ',my_nx); 
    debug('ny : ',my_ny);
    debug('nz : ',my_nz); 
    debug('rotation'); 
    debug('rx : ',my_rx); 
    debug('ry : ',my_ry); 
    debug('rz : ',my_rz); 
" 
/>


the ev_raytomesh is expecting an origin position vector XYZ and a direction vector XYZ
plugin[navigator].ev_raytomesh(ox,oy,oz,dx,dy,dz,my_d,my_x,my_y,my_z,my_nx,my_ny,my_nz,my_rx,my_ry,my_rz);
If the ray that we generated intersects with the mesh we are going to get the same values as above saved in the variables name that we provided.

Happy coding

Kind regards
everpano.com step beyond 360

2

Friday, April 8th 2022, 3:24pm

pretty cool you could implement that *thumbup* !

3

Tuesday, May 10th 2022, 4:49am

Hello,


I found that some of the cube faces could not get the correct mesh coordinates, but I have drawn cubes in Everpano.
In the third picture, for example, I couldn't get the right coordinates on the side.


Hope this helps.




cejune has attached the following images:
  • Dingtalk_20220510104549.jpg
  • IMG_2917.HEIC.JPG.JPG
  • IMG_2916.HEIC.JPG.JPG

jordi

Professional

  • "jordi" started this thread

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

4

Wednesday, May 11th 2022, 9:20am

Hi,

could not get the correct mesh coordinate

If you can provide the project file we can take a closer look.

Kind regrads
everpano.com step beyond 360

5

Thursday, May 12th 2022, 9:45am

Hi,

could not get the correct mesh coordinate

If you can provide the project file we can take a closer look.

Kind regrads
cejune has attached the following file:
  • project3D.zip (108.89 kB - 89 times downloaded - latest: Today, 10:51am)