#Dominate Vector

1 messages · Page 1 of 1 (latest)

tribal wigeon
#

How would I get a Dominate Vector in rec room? Like if I get the up position of an object it will still say 0, 1, 0 instead over its real up vector (4, 9, 0) because its closer to 0, 1, 0 than 1, 0, 0 (Also for reference this is also with the forward of the object (swing handle) being to the side instead of forward.)

flat steppe
#

Not sure what you are wanting. Either normalise the vector, or use vector create and set to 0,1,0

tribal wigeon
flat steppe
#

Hmm that's quite interesting.

#

Will it work if you take the highest number and set to that as 1, and 0 for others

tribal wigeon
#

i dont belive normalise does that either

tribal wigeon
flat steppe
#

Take the biggest number in the vector and set to 1. Take everything else and set to 0.

5,9,8 => 0,1,0

#

Not 100% sure if it will work so lmk

tribal wigeon
#

ive asked chat gpt (yes ik not a great source) but it game me the answer in python, so if you understand that I could send it over

tribal wigeon
#

wait hwo would I even do that?

shell lion
#

@tribal wigeon @flat steppe

I've done this before, its not an elegant method but its the one I used for aligning a cube in my puzzle game to the "nearest" vector

Dot all vectors by your direction, put the values into List<Float>, and get the highest using List Max, get the index of the highest with List Get First Index Of, and then get the vector with that index by putting the input vectors into a list aswell

You could optimize this will a loop which would support an infinite amount of vectors for the same number of chips (This is the elegant method)

tribal wigeon
#

i dont even know what to point out that I don't understand

tribal wigeon