Post number #1027489, ID: 3be503
|
What can I use to turn x y position or direction to a number from 1 to 360 of sorts
Post number #1027601, ID: 07baf3
|
Polar coordinate system?
Post number #1027602, ID: d844ba
|
welcome to NHK
Post number #1027608, ID: f04e00
|
plus sin, cos, yeah. >>1027601
Post number #1027688, ID: 064a38
|
>>1027601 how so?
Post number #1027776, ID: 07baf3
|
>>1027608 Yep! >>1027688 Instead x and y the Cartesian coordinates use polar angle phi = arctan(x/y), that changes in interval [0,2pi] in radians or in [0°,360°] of degrees, and radius r = sqrt(x^2 + y^2), of course.
Post number #1027785, ID: 1efc2c
|
>>1027776 ...I dont feel like using these symbols. anything else i can use that is just x and y? like can i change phi to something else or arctan or ^2?
Post number #1027857, ID: 45125d
|
trig math
Post number #1027895, ID: f7521d
|
>>1027857 something else?
Post number #1027896, ID: 07baf3
|
>>1027857 Yep, again! >>1027785 Of course you can use your own variable names, I just used traditional ones, like Greek character called phi for angular variable. The sign ^ means get power of the thing before sign in value that after sign. For example x^y means the power of x with exponent y. Some languages used ** (double *, the asterisk sign) as sign of exponent similar to the sign ^.
Post number #1027897, ID: 07baf3
|
>>1027785 to continue>>1027896 The r is radius-vector, sqrt is "square root" and that formula just is the length of vector like the one in Euclidean space.
And the arctan is arctangent.
All formulas are ones that to transfer from Cartesian coordinates to polar ones. But you can directly work with polar coordinates at very beginning. All are depend on your considered problem and your goal, what the result you want obtain.
Post number #1027898, ID: 07baf3
|
>>1027785 to continue>>1027897 And, finally, you can name angular variable as x, and radius vector as y. But I do not recommend it, cos it may make confused one who will read your code.
Post number #1028005, ID: fd7235
|
>>1027896>>1027897>>1027898 no as in i need alternative method to produce sprite index from 1 to 12 back to 1 and then 12, all in clockwise or counter clockwise as according. basically like angles or radians etc but i want it "sustained" with only + - / and not even multiplications. walking around the xy coordinates or use events but no fancy maths >https://vlix.io/video/290fa60eb31b5fc917ad/
Post number #1028006, ID: fd7235
|
like how these sprite rotate only in one single direction, from facing up to right to facing down and then no left side so you have to flip... so i need something else for billboarding >>1028005
Post number #1028059, ID: 07baf3
|
>>1028005 >but i want it "sustained" with only + - / and not even multiplications. Oh, i think
Post number #1028061, ID: 07baf3
|
>>1028059 *missclick* let me try again. >but i want it "sustained" with only + - / and not even multiplications. Oh, I think you should use (work) with quaternions (on two-dimensional space) instead vectors (i.e. the x and y coordinates). Like Unity and some other engines that are use quaternions to represent "rotation".
Post number #1028111, ID: 59a2ca
|
>>1028061 how do you do so.
Post number #1028182, ID: 07baf3
|
>>1028111 I am not work with it now (in Unity in past) , even with programming the graphic. Not remember it, and that's not simple to explain it here. You should look how it realized in your libraries, and more learn on hypercomplex numbers.
Post number #1028385, ID: 36c663
|
>>1028182 well i just need to rotate this sprite but it does not look correct apparently https://vlix.io/video/6ab36c2904d3ba857305/
Post number #1028389, ID: 1ed83d
|
Op I say this with love in my heart but you should consider using a different game engine.
Post number #1028390, ID: 36c663
|
>>1028389 it's som uch fun tho. i can click and shit. 1 point something megabyte. i even already made a whole spinning projection. you cant possibly offer me anything else at all at this point except a rotation solution but without using anything else but +-/ and no angles.
Total number of posts: 21,
last modified on:
Sun Jan 1 00:00:00 1727163330
| What can I use to turn x y position or direction to a number from 1 to 360 of sorts