Monster shadow

VIDEO

Unity Vector3.Cross Visualized

Description:
Vector3.Cross provides you with the cross product of two vectors. Vector3.Cross is easy to understand, but sometimes hard to find applicable uses for when just starting out. I'll teach you what a cross product is, how to use vector3 cross, and a real-world use case for it (all in 90 seconds!) I used 'Shapes' to make a few (most) of these effects, you can check it out here: https://assetstore.unity.com/packages/tools/particles-effects/shapes-173167?aid=1011lkRxs ❤️ Become a Tarobro on Patreon: https://www.patreon.com/tarodev ========= 🔔 SUBSCRIBE: https://bit.ly/3eqG1Z6 🗨️ DISCORD: https://discord.gg/GqeHHnhHpz ✅ MORE TUTORIALS: https://www.youtube.com/tarodev Vector3.Cross official description: Cross Product of two vectors. The cross product of two vectors results in a third vector which is perpendicular to the two input vectors. The result's magnitude is equal to the magnitudes of the two inputs multiplied together and then multiplied by the sine of the angle between the inputs.
ADD A COMMENT

Tughlok Siddiquee
Just curious, do you make these visualization animation in Unity?
Tarodev
Line renderers, shapes by freya and a loooooot of lerping
우김
매우매우매우매우 깔끔한 설명
DArK
This is some really high quality stuff... Subbed. Can u please make this kind of series for Godot engine?
dandandan
Unfortunately you didn't make me stick my hand up in the air like a doofus, but I still enjoyed the vid so I'll sub 😄
SilentWisp Games
These videos are fantastic. Love the visual explanations.
mazetar
How isn’t this in the top three most viewed unity channels?
Tarodev
Maybe one day 😜
Dampish
i dont get it, why cant you just do a +90 ina euler quaternion? and isnt it always going to be 90 degrees? would you have to do 4 of these, for each direction?
Dampish
@Tarodev thanks alot for responding and helping me understand!!😄👍
Tarodev
The point is finding which axis you need to rotate on, then you can use whatever method you'd like to actually rotate 😉
ГеймДеб
4k content delivery👍
MarkRiverbank
This is fine…but now explain the significance of the magnitude if using non-normalized vectors.
Tao
Estos vídeos son geniales! Good job man
Zak Kaioken 2
shapes is my favorite unity package
Tarodev
@Zak Kaioken 2 yeah instead of making them transparent I should have just darkened the lines closer to the background color. Good tip!
Zak Kaioken 2
​@Tarodev Same i love it so much and there's so much you can do it's ubsurd!!! My favorite thing to do is smoothly animate using immediate mode shape drawers but i also do love playing around with it's ability to work inside masks and stensil buffers!! I have a tip for the wierd ghosting on the transparent lines you use for your grid, if you make them a solid color they won't visually sit ontop of intersecting shapes when they collide it's cool that way :)
Tarodev
Oh man, I'm obsessed
Tomatech
I used to think Vector3.Cross returned (A.x*B.x, A.y*B.y, A.z*B.z)
Squeaky Bunny
I think this video would have been even better if you had taken a moment to explain the length of the resulting vector.
Chris Johnson
damn it where were you like 3 or 4 years ago you could have saved me so much headache.
Tarodev
Apologies brother 😂
Cisco
I did the doofus thing~
OverInfrared
Why are you so unknown in the unity community, your videos are amazing.
Tarodev
I'm working on it... she's a hard girl to crack 😢
Myroslav Dovhaliuk
I'm really happy this channel exists! Thank you!
Jose Manuel
I absolutly loved this <3
SlothinkDev
Finally a channel who explain usefull function of unity. Now i have motivation to gamedev again
Balasubramani Mudaliar
Nice Job.
SEE ALL COMMENTS


Transcript:

let's say we have two directions a and b we can find the cross product of these
vectors by calling vector 3 cross using both a and b as inputs
the cross product will always be perpendicular to both vectors
a quick way to mentally work out the cross product is by using the left hand
rule if you point your thumb and index finger
in the directions of a and b your fu finger will be equal to the cross
product vector3 cross has a wide range of practical uses in engineering and
game dev but let's just use the simple example of
rolling a cube assume the user pressed down
we need to work out the correct rotational axis to perform the roll
vector3 cross gives us an easy way to calculate this
for our second input we'll use vector3 up this will be our constant to ensure
the queue rolls correctly regardless of direction or current cube rotation
for the first input we'll use the direction of the user input so in our
case vector three back the cross product will always be perpendicular to both
inputs which gives us a direction pointing down the x-axis
now we know we need to rotate our cube on the x-axis
so to summarize if you know up and you know which direction you'd like to
rotate it's easy to work out the rotational axis using the cross product
alright i hope you found this fun and informative subscribe if i made you
stick your left hand in the air like a doofus or if you'd just like to see more
of these fun little visualizations subscribe anyway
alright see you later