Raydium 3D Game Engine https://memak.raydium.org/ |
|
How get the windod 2D coordinatet for a 3D point https://memak.raydium.org/viewtopic.php?f=8&t=852 |
Page 1 of 1 |
Author: | vicentecarro [ Tue Sep 16, 2008 12:11 pm ] |
Post subject: | How get the windod 2D coordinatet for a 3D point |
I have a 3D position (x,y,z) and I want to know the coordinates of 2D window that correspond to the projection of that point. How can i do that? |
Author: | Xfennec [ Tue Sep 16, 2008 9:13 pm ] |
Post subject: | Re: How get the windod 2D coordinatet for a 3D point |
See raydium_osd_printf_3D() for instance, it did that sort of "unproject" things. We may even provide this feature as a function (raydium_math_3D_unproject() ?) since it's a quiet common need, don't you think ? |
Author: | vicentecarro [ Tue Sep 16, 2008 11:14 pm ] |
Post subject: | Re: How get the windod 2D coordinatet for a 3D point |
Hmm, yes, i'll try |
Author: | vicentecarro [ Wed Sep 17, 2008 11:54 am ] |
Post subject: | Re: How get the windod 2D coordinatet for a 3D point |
Done. I've changed the name a bit to be more friendly with our "autocompletion" rule. Now it is: raydium_math_point_unproject_3D Also I've added a new function (that I think is quite usefull) to get the real radian angle of a vector given by its X and Y projections: raydium_math_angle_get_from_projections (As well I have tried to get the autocompletion idea here) |
Author: | Xfennec [ Wed Sep 17, 2008 8:43 pm ] |
Post subject: | Re: How get the windod 2D coordinatet for a 3D point |
Nice. I'll update a bit the unproject function (when sz>1), and factorize a bit code so that printf_3D use this function. About the other function, the "get" from the name seems a bit useless to me (if you call the function, it's because you want to get something) and is redundant with function prototype. But "raydium_math_angle_from_projections()" seems ok to, if you want to update the name. I wonder if I'm not some sort of function names monomaniac, or something I must admit that I don't *really* understand what this function did, anyway (the problem is on my side, don't worry) Just curiosity, but what do you mean by vector projection ? Projection on what ? |
Author: | ouille [ Wed Sep 17, 2008 9:22 pm ] |
Post subject: | Re: How get the windod 2D coordinatet for a 3D point |
Hello, This function looks like atan2 ? no ? Have a nice day. Ouille. |
Author: | vicentecarro [ Wed Sep 17, 2008 10:37 pm ] |
Post subject: | Re: How get the windod 2D coordinatet for a 3D point |
well... Looks like atan2 but atan2 returns in the range -PI to PI and our returns in range 0 to 2*PI About the name... ok, the get maybe is useless here ( if fact we can not set anything) Commit done. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |