mathc icon indicating copy to clipboard operation
mathc copied to clipboard

quat_look_at

Open ghost opened this issue 4 years ago • 4 comments

I tried to find this function or an equivalent, but it seems to be missing: quat_look_at

I see matrix equivalents, but it would be really useful to be able to do this one with quaternions. From the internet it looks like this is commonly available in other quaternion libraries (e.g. Ogre3D's quaternions offer this) so it doesn't seem like a super arcane function either. Would be really cool if it could be added some day!

ghost avatar Feb 12 '20 07:02 ghost

Is it quat_from_vec?

RandyGaul avatar Feb 12 '20 07:02 RandyGaul

You can always use handmade math https://github.com/HandmadeMath/Handmade-Math if you want a C alternative. I also have my own C++ math header I personally use over at cute headers https://github.com/RandyGaul/cute_headers

Unless I’m mistaken I do think mathc is losing support for the time being. It seems to be in a decent state, but if you have questions or want updates it’s best to move to an alternative imo.

RandyGaul avatar Feb 12 '20 07:02 RandyGaul

Is it quat_from_vec?

Interesting question! I assumed this first as well and played around with quat_from_vec3 for hours but it gave me strange results, and sadly due both the weird function name and unnamed parameters it's not really clear to me what parameter would be the upvector if that is even the look at function at all. So maybe it is? But I couldn't really get it to work (might also be my buggy surrounding code though) and seems to me more like it isn't. But again, I don't know

You can always use handmade math

Ok, I will look at it! As for cute_headers, a C++ library is of no use to me since I am writing in C. I wouldn't mind staying with mathc though, as you already pointed out its state seems decent. But some of the parameter naming and (lack of) function descriptions are indeed a bit of a struggle for me.

ghost avatar Feb 12 '20 08:02 ghost

I'm still using this library because i'm using C, and because this library is the only compatible with OpenWatcom 2.0.

hydexon avatar Sep 07 '21 13:09 hydexon