ErdongChen-Andrew / ECSpace

Personal portfolio website
ecspace-test.vercel.app
6 stars 1 forks source link

Physics question #3

Open marsblars opened 10 months ago

marsblars commented 10 months ago

Hey I've been following and enjoying your work and I wanted to reach out to see if you could guide me in the right direction. I've been working on setting up a portfolio website the follows the same direction as yours. More specifically being able to move the character freely around a planet without falling off. After looking over your world.js file I get a decent understanding of how you were able to achieve that. My issue comes when I try to follow the same path but using your Ecctrl Floating Capsule Character Controller since it uses React Three Rapier instead. I've been attemting to do this by rotating the planet in the opposite direction of the characters movement but i've been getting mixed results and I feel like this could be accomplished more effectively with rapier using physics concepts like gravity and normal forces, I've tried to follow the rapier docs but am having trouble finding specifics for react. I am just not sure if I should be focusing at modifying the ecctrl characters physics or the planets physics or if I should just stick to rotating the planet. I hope this is the right place to ask this, I didn't want to open an issue for the ecctrl repo and I would seek help from outside sources but since you developed the character controller and also accomplished what I am trying to do I just had to see if I was overlooking something. Anyways thanks for the awesome character controller!

ErdongChen-Andrew commented 10 months ago

Hey @marsblars ! Thanks for your interest in my projects! Actually, I'm also considering using Ecctrl on a planet, but this would require substantial changes to the Ecctrl source code. I haven't delved into it yet, not sure if rotating the planet is a good idea. This way you need to rotate everything else in the scene, including the environment background. At this point, I cant provide any specific suggestions, I will have to try and test it out myself. Sorry about that :(

marsblars commented 10 months ago

Thanks for clearing that up! I see the problem with rotating the planet now, I didn't consider the effects that would have on any future additions to the scene. I will keep looking into figuring out the physics as your project was my first exposure to rapier so I definitely need to study the docs more.
Thanks again!