javascript - Three.js rotate vector and screen edge detection -


i have vector i'm trying keep length rotate 90deg on colliding screen edge, gives me weird out effect… don't know can doing worn happens when try apply matrix , euler transform… screen detection, have okj detecting on , off screen, handy know if it's bottom, top, righ or left edge… clues? thanks!

var direction = new three.vector3(-0.2, -0.2, 0); var = new three.euler( (math.pi/2), 0, 0, 'xyz' ); direction.applyeuler(a); 

for collision; i'm using following:

camera.updatematrixworld(); // make sure camera matrix updated camera.matrixworldinverse.getinverse( camera.matrixworld ); cameraviewprojectionmatrix.multiplymatrices( camera.projectionmatrix, camera.matrixworldinverse ); frustum.setfrommatrix( cameraviewprojectionmatrix );  console.log(frustum.intersectsobject(textmesh)); 

i removed line reversed camera projection matrix.

the screen edges became object "outside" view, whom objects can actively collide.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -