p5.EasyCam icon indicating copy to clipboard operation
p5.EasyCam copied to clipboard

Rotations around world axes

Open DavidResin opened this issue 6 years ago • 4 comments

Hey there,

Thanks a lot for this plugin, it's really helping out!

I'm using p5 for a visualization for a project, but I'm having trouble making an orbiting camera that stays upright. By that I mean having no roll and and making yaw rotation around the world coordinates instead of the camera coordinates, like you would see in any video game where you see the world from above or even when you look around in Blender. I have tried many approaches but haven't managed so far, do you have any idea?

Thanks a bunch!

DavidResin avatar Apr 26 '18 11:04 DavidResin

hi there. i guess it's too late, but i'm curious if you managed to solve it! i faced same problem here, so i thought it would be ok if i set the distance to be (1,0). i mean just close to the camera. now if i drag mouse, the camera will rotate around itself (by one pixel difference) and it looks good in this way... what about you?

nevahid avatar Apr 09 '19 09:04 nevahid

Oh my god that was almost a year ago. I completed this project without p5 in the end. I used Three.js and here is what I settled with:

camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
controls = new THREE.OrbitControls( camera, renderer.domElement );

DavidResin avatar Apr 10 '19 13:04 DavidResin

Yup... sooo late... time really flies... :-) thank you anyway...

nevahid avatar Apr 10 '19 14:04 nevahid

My pleasure!

DavidResin avatar Apr 10 '19 15:04 DavidResin