hanghoavacongluan.vn
  • Trang chủ
  • Thời sự
  • Kinh doanh
    • Doanh nghiệp
    • Chứng khoán
    • Ngân hàng
    • Nhà đất
  • Thị trường
    • Năng lượng
    • Nguyên liệu
    • Nông sản
    • Vàng
    • Hàng thật – hàng giả
  • Đời sống
    • Ẩm thực
    • Du lịch
    • Giải trí
    • Làm đẹp
  • Sức khoẻ
  • Tiêu dùng
  • Công nghệ
  • Ô tô – Xe máy
  • Trang chủ
  • Thời sự
  • Kinh doanh
    • Doanh nghiệp
    • Chứng khoán
    • Ngân hàng
    • Nhà đất
  • Thị trường
    • Năng lượng
    • Nguyên liệu
    • Nông sản
    • Vàng
    • Hàng thật – hàng giả
  • Đời sống
    • Ẩm thực
    • Du lịch
    • Giải trí
    • Làm đẹp
  • Sức khoẻ
  • Tiêu dùng
  • Công nghệ
  • Ô tô – Xe máy
No Result
View All Result
hanghoavacongluan.vn
No Result
View All Result
Home Đời sống Giải trí

Game Math Theory – VECTORS

2 years ago
in Giải trí
Game Math Theory – VECTORS

this video is brought to you by our own Metta thank you so much for donating if you want to support breakage yourself you can go to patreon.

LIÊN QUAN

Làm thế nào để chọn một trang web cá cược phù hợp?

4 Lời khuyên để giành chiến thắng khi cá cược bóng đá

Xu hướng chơi game casino online, Tại sao? Lợi ích

com/scishow so we want to welcome to the first video in the patreon funded game math theory a series that covers essential mathematical concepts that you will definitely run into during your game development career today we will be looking at vectors before we get into how a vector is defined let's have a look at why they're useful vectors are often used when we want to move a character around the scene let's say that we want to move our character two units to the right and one unit up what we essentially do is create a vector which we represent with an arrow that points in that direction we can then add this vector on to the position of our character to make him move if we were to write down this vector mathematically we would write to one because the vector moves to one the x + 1 on the Y we say that a vector is defined by direction and a length in our case the direction of the vector is where we want our character to point and the length of the vector is how far our character should walk in that direction if we wanted our character to then move one unit to the left we would make a new vector with the coordinates minus one zero because the vector goes minus 1 on the X and zero on the Y however you will quickly notice that the coordinates only show what the vector looks like and not where we should place it in the scene that is because vectors don't have any inherent position that allows us to draw it anywhere we want it is only when we combine it with the position of our character that the vector adds anything meaningful to our example now let's look at another example where victors come in handy say we have a scene with two players player a and player B and we want to find the distance between the two well both players have a position which means where they are in relationship to the center of our level in this example player a has a position of two one because he's two units from the center on the X and one unit from the center on the Y likewise player B has a position of 1/4 because he's one unit from the center on the X and four units from the center on the Y we can now create a vector that points from player a to player B to do this we subtract the position of player a from the position of player B this is done in the easiest way possible by first subtracting the X components 1 minus 2 equals -1 then we subtract the Y components 4 minus 1 equals three and the result is a vector with the coordinates minus one three let's try to draw this in our scene we can see that the vector correct it goes from player a to player B but how do we calculate the length of this vector that is in fact really easy the length of a vector can be written as the square root of x squared plus y squared note that the length of a vector is referred to as the vectors magnitude if you wonder why the length of a vector is defined using this particular formula you can try to think of the vector as the hypotenuse of the triangle created by the vector coordinates and then use Pythagoras theorem to calculate the length of that side but you could of course just use the formula as is so if we want to calculate the distance between our players we simply insert the x and y coordinates of the vector into the formula and voila the distance from player a to player B is three point one six units the same thing is extremely easy to do in three dimensions as well all the vectors now simply have a third component the z axis which is also added into the formula at this point you might be thinking why do I need to know all of this my game engine has an easy function for getting the distance between two points in space well an example of why this knowledge might be useful to you is the fact that it has just allowed us to make a very important optimization in our code say that we are making a racing game and we have two players a and B who are competing to reach the goal and in our game we want to display who is currently ahead in that case we might subtract the position of each player from the position of the goal to get two vectors from our players to the goal we could then get the length of each vector using the form left from before and compare them to find out which car is closest however using the square root of Raider can be pretty taxing on the computer and doing this calculation a lot of times during a game might lead to performance issues since that we could simply remove the square root and only compare the remaining x squared plus y squared this doesn't give us the actual length of the two vectors but it still shows what vectors greater than the other which makes it perfect for doing a comparison between the two so that is pretty much all I have to show for this video if you're interested in learning more about vectors that's the link for that in the description hope you enjoyed the first part of game math Theory next I hope to cover the magic of sine waves if you want to support the series you can do so on my patreon page thanks for watching and I'll see you in the next thank you so much to all of the awesome patreon supporters who donated in August and the special thanks to our and Metta Robert Rogers Calhoun Vixen P and Andrew K.

Related Posts

Làm thế nào để chọn một trang web cá cược phù hợp?

Làm thế nào để chọn một trang web cá cược phù hợp?

by Hàng hoá và công luận
December 14, 2021
0
0

Nếu bạn đang tìm kiếm một nhà cái đáng tin cậy tại Việt Nam để xem tỷ lệ kèo Ngoại...

4 Lời khuyên để giành chiến thắng khi cá cược bóng đá

4 Lời khuyên để giành chiến thắng khi cá cược bóng đá

by Hàng hoá và công luận
December 21, 2021
0
0

Tất cả những ai đã từng tham gia cá cược bóng đá chắc chắn đều mơ tưởng về việc cá...

Xu hướng chơi game casino online, Tại sao? Lợi ích

by Hàng hoá và công luận
April 12, 2021
0
0

Ở thời đại công nghệ 4.0 lên ngôi như hiện nay, việc chơi game casino online đang dần trở thành...

RUPRISE S12E06 – WELCYUM TO SNATCH GAME

RUPRISE S12E06 – WELCYUM TO SNATCH GAME

by
August 25, 2020
0
0

don't let me in the bottom no but uh how did you feel about being towards the bottom but I...

Melted Cheese Pictionary Game

Melted Cheese Pictionary Game

by
August 25, 2020
0
0

(rooster crowing)(animal roaring) (wheel clacking) - Welcome to Good Mythical More. We're gonna play Pictionary with cheese. - But first...

Next Post
Duke v. Kansas in 2018 Elite Eight (Full Game)

Duke v. Kansas in 2018 Elite Eight (Full Game)

How Difficult Games Can Help With Difficult Times

How Difficult Games Can Help With Difficult Times

RECOMMENDED

Dự đoán kết quả bóng đá cho các trận đấu EPL sắp tới

Dự đoán kết quả bóng đá cho các trận đấu EPL sắp tới

January 4, 2022
0
Làm thế nào để chọn một trang web cá cược phù hợp?

Làm thế nào để chọn một trang web cá cược phù hợp?

December 14, 2021
0

HIỆP HỘI CHỐNG HÀNG GIẢ VÀ BẢO VỆ THƯƠNG HIỆU VIỆT NAMTRUNG TÂM TƯ VẤN, HỖ TRỢ DOANH NGHIỆP VÀ PHÁT TRIỂN THƯƠNG HIỆU (GBC) Giấy phép số 131/GP - TTDT, Cục Phát thanh truyền hình và Thông tin điện tử - Bộ Thông tin và Truyền thông cấp ngày 8/9/2015 Văn phòng Hà Nội: số 930, đường Trương Định, phường Giáp Bát, quận Hoàng Mai, Hà Nội Văn phòng đại diện tại Hải Phòng: Số 3 Lê Thánh Tông - Quận Ngô Quyền - Tp Hải Phòng. Điện thoại: 024.6260.1324 - 098 111 5848- 0904 658575Email: trungtamgbc@gmail.com Độc giả có thể gửi bài viết qua email: hanghoavacongluan.vn@gmail.com© Ghi rõ nguồn "Hàng hóa và Công luận" khi phát hành lại thông tin từ Website này. (Mọi thông tin lấy từ hanghoavacongluan.vn phải ghi rõ nguồn cấp)

CATEGORY

  • Ẩm thực
  • Chứng khoán
  • Công nghệ
  • Doanh nghiệp
  • Du lịch
  • Đời sống
  • Giải trí
  • Hàng thật – hàng giả
  • Kinh doanh
  • Làm đẹp
  • Ngân hàng
  • Nhà đất
  • Nông sản
  • Ô tô – Xe máy
  • Sức khoẻ
  • Thị trường
  • Thời sự
  • Tiêu dùng
  • Vàng

Đối tác liên kết

Foot.vn - Review giày


Nhiet.vn - Đánh giá sản phẩm

© 2020 Hanghoavacongluan.vn -Trung Tâm Tư Vấn, Hỗ Trợ Doanh Nghiệp Và Phát Triển Thương Hiệu (GBC)

No Result
View All Result
  • Doanh nghiệp
  • Nguyên liệu
  • Chứng khoán
  • Đời sống
  • Ngân hàng
  • Vàng
  • Thị trường
  • Hàng thật – hàng giả
  • Công nghệ
  • Nông sản
  • Food

© 2020 Hanghoavacongluan.vn -Trung Tâm Tư Vấn, Hỗ Trợ Doanh Nghiệp Và Phát Triển Thương Hiệu (GBC)