this post was submitted on 16 Aug 2024
155 points (98.7% liked)

PC Gaming

8211 readers
408 users here now

For PC gaming news and discussion. PCGamingWiki

Rules:

  1. Be Respectful.
  2. No Spam or Porn.
  3. No Advertising.
  4. No Memes.
  5. No Tech Support.
  6. No questions about buying/building computers.
  7. No game suggestions, friend requests, surveys, or begging.
  8. No Let's Plays, streams, highlight reels/montages, random videos or shorts.
  9. No off-topic posts/comments.
  10. Use the original source, no clickbait titles, no duplicates. (Submissions should be from the original source if possible, unless from paywalled or non-english sources. If the title is clickbait or lacks context you may lightly edit the title.)

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] kralk@lemm.ee 15 points 3 weeks ago* (last edited 3 weeks ago) (9 children)

I love Godot, I've followed some of the tutorials but I think I'm too stupid to ever understand vectors.

[–] catloaf@lemm.ee 1 points 3 weeks ago (2 children)

A vector is just a group of numbers. That's literally all it is.

But the most common use is to describe something in three dimensions, usually a point in 3D space (x,y,z), or motion (still x,y,z but those numbers are in meters per second or something). But you could also use it for a color (r,g,b).

But what most people mean when they say "vector" is a set of three numbers, where two are direction and one is magnitude. You know how they're usually represented by an arrow? The direction components determine which direction that arrow points, and magnitude is the length of the arrow. (In two dimensions, this would probably be degrees of rotation and distance, like in a polar coordinate system.)

There are mathematical conversions you can do to translate one of those vectors into other forms. One popular one is a conversion to get the coordinates of the point at the top of the arrow.

[–] weker01@sh.itjust.works 7 points 3 weeks ago (1 children)

I can't resist. I've been indoctrinated by my math classes: "A vector is an element of a vector field."

A bunch of numbers is not immediately a vector. To be a vector you need the defining functions of a vector field also. Like addition and scalar multiplication.

[–] catloaf@lemm.ee 5 points 3 weeks ago

In pure mathematics, that's. In game engines, a vector is a data type, and you can stuff whatever the fuck you want in its components. Not saying you should, but you can.

Generally they're just used where they make sense, like the direction+magnitude example. RGB is a little weird until you realize that a color is really just a point in a 3D space along the red, green, and blue axes.

load more comments (6 replies)