Unity from Proficiency to Mastery (C# Programming): Master C# with Unity by Patrick Felicia
Author:Patrick Felicia [Felicia, Patrick]
Language: eng
Format: azw3
Published: 2017-10-29T04:00:00+00:00
Now that we have clarified the calculation of the cosine, let’s explain how we can find the vectors V1 and V2. V1 is the forward direction for the NPC. This vector originates (on the diagram) from the NPC and is going in the direction of the positive z-axis. V2 is determined by the position of both the NPC and the player.
Let’s see how: as you can see on the next diagram, the vectors V2, Vnpc and Vplayer form a triangle. Vnpc is the vector for the position of the NPC and it starts at the origin of the coordinate system. Vplayer is the vector for the position of the NPC and, as for the previous vector, it starts at the origin of the coordinate system. If we operate a clockwise loop from the origin of the coordinate system, we can go from the origin of the coordinate system to the NPC by following the vector Vnpc, then follow the vector V2 (from its tail to its head), and then follow the vector Vplayer in reverse (that is, from its head to its tail; this is the same as -Vplayer) to be back to the origin of the coordinate system. So we could say that: Vnpc + V2-Vplayer = 0; in other words, by following Vnpc, then V2, and then Vplayer in reverse, we end up at the same point. Following this, we can then say that: V2 = -Vnpc + Vplayer (we just added -V2 to both sides of the previous equation) and this is how we can calculate V2.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Art of Coaching Workbook by Elena Aguilar(51139)
Trainspotting by Irvine Welsh(21612)
Twilight of the Idols With the Antichrist and Ecce Homo by Friedrich Nietzsche(18605)
Fangirl by Rainbow Rowell(9215)
Periodization Training for Sports by Tudor Bompa(8237)
Change Your Questions, Change Your Life by Marilee Adams(7719)
This Is How You Lose Her by Junot Diaz(6857)
Asking the Right Questions: A Guide to Critical Thinking by M. Neil Browne & Stuart M. Keeley(5741)
Grit by Angela Duckworth(5577)
Red Sparrow by Jason Matthews(5451)
Paper Towns by Green John(5164)
Room 212 by Kate Stewart(5091)
Ken Follett - World without end by Ken Follett(4706)
Housekeeping by Marilynne Robinson(4421)
The Sports Rules Book by Human Kinetics(4367)
Double Down (Diary of a Wimpy Kid Book 11) by Jeff Kinney(4252)
Papillon (English) by Henri Charrière(4238)
The Motorcycle Diaries by Ernesto Che Guevara(4073)
Exercise Technique Manual for Resistance Training by National Strength & Conditioning Association(4049)