Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm making a video game, and I want to map a joystick position to a rotation (of a sword). I have a set of keyframes for certain joystick positions, and I want to interpolate between the three nearest ones to create a continuous function from joystick position to sword rotation.


OK. What kind of positions can the joystick take?

I.e., is it a point on a hemisphere (equivalently, X/Y controller)?

And what kind of rotations are you talking about for the sword? Are they constrained in any way? I'm assuming it's attached to something - is that point moving too?

Finally why do you need to interpolate? Why three? What are you interpolating between?

I.e. why not simply convert the input of the joystick to a rotation - you're literally rotating a stick when you're moving a joystick in the first place.

You don't need interpolation to convert a rotation (of the joystick relative to its base) to the rotation of the sword unless you're doing something that I don't understand.

If you describe what you're doing in detail, I think we might save you a deep dive into deeper math than necessary for this (..or dive into even deeper math :).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: