
Advertisement
This topic is 1803 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.
If you intended to correct an error in the post then please contact us.
Recommended Posts
alh420 5995
Normal numbers (scalars) has just a magnitude (the value).
A vector has both magnitude and a direction.
There is several possible ways to represent a vector, but in computer graphics, we often use euclidian space, and there we represent the vector as three scalar "coordinates", x,y and z. (in some cases polar coordinates might be more convenient, maybe using them would have solved the problems the developers had)
Vectors, representing a magnitude and a direction is very convenient when working with positions and directions in space.
A "position" is a vector from origo to the point in space where we want to be.
A "direction" is usually represented as a normalized vector. A normalized vector is a vector where magnitude is always 1.
"up", "forward", "left/right" is normalized direction vectors used to rotate an object in the space.
you need to know these three to know how to place the object in the world.
To get more information on how to do math with vectors, look up Linear Algebra
Edited by Olof HedmanHelixirr 141
Vectors are objects that can be added, subtracted and multiplied by numbers (scaled). They can represent a large variety of things, but a couple of relevant ones in this context are velocities and translations.
In a 3dimensional vector space, you can pick three vectors (like "forward", "right" and "up") and express any vector as a linear combination of those three. "Linear combination" means an expression like C1*forward + C2*right + C3*up, where C1, C2 and C3 are real numbers. The three vectors are said to be a basis of the vector space.
The problems that arise when you handle curved space using vectors in a naive way are probably the result of trying to use affine geometry where differential geometry should be used.
Normal numbers (scalars) has just a magnitude (the value).
A vector has both magnitude and a direction.
There is several possible ways to represent a vector, but in computer graphics, we often use euclidian space, and there we represent the vector as three scalar "coordinates", x,y and z. (in some cases polar coordinates might be more convenient, maybe using them would have solved the problems the developers had)
Vectors, representing a magnitude and a direction is very convenient when working with positions and directions in space.
A "position" is a vector from origo to the point in space where we want to be.
A "direction" is usually represented as a normalized vector. A normalized vector is a vector where magnitude is always 1.
"up", "forward", "left/right" is normalized direction vectors used to rotate an object in the space.
you need to know these three to know how to place the object in the world.
To get more information on how to do math with vectors, look up Linear Algebra
Both of these replies tell us what vectors consist of, a direction and a magnitude. I know this already, but of course it is helpful for newcomers. I'm also aware cross and dot products etc.
The problem I'm having is that I can't distinguish the difference between two different approaches, the use vectors direction, position and velocity or the use of vectors forward, left/right and up. Here are two examples of two diffent approaches:
http://blog.wolfire.com/2009/07/linearalgebraforgamedeveloperspart1/
and
the video I already posted.
What are the benefits of whichever approach?
C0lumbo 4415
That's a 20 minute video. Could you point to the bit where the developers talk about their nonstandard approach?
Helixirr 141
That's a 20 minute video. Could you point to the bit where the developers talk about their nonstandard approach?
Of course. The interesting part and the part relevant to the topic starts after 06:25. I wouldn't call the approach "nonstandard", though. It's just, you know, different.
I'm trying to explain my problem the best I can, but it's difficult. I hope you get the gist of what am I looking after.
Edited by HelixirrPolarist 172
You're talking about different concepts.
Practically every 3d game will find a use for forward, up, and right vectors. But they also need direction, position, velocity vectors for each entity.
In the context of the video, forward, up and, right are are constantly changing (as opposed to most games which can hardcode "up" to an arrow pointing along the positive y axis, meaning that only forward and right are changing.) The three directions are a basic inputs used, among other things, to orient the player and to orient the camera (set up a "view matrix" and "projection matrix"). Their optimization was that in a spherical world, the up vector could be calculated simply by taking the position of the player and subtracting the center of the world. This makes it cheap to calculate the right vector. This is compared to a more general approach of finding the normal vector that corresponds to the polygon that you're standing on (the collision approach he describes as super expensive).
I watched the entire video (thanks, it was interesting), but they did not compare forward, up, right to direction, position, velocity, directly. They are not competing concepts. Defining forward, up, and right are useful constructs to describe orientation, in general. Where as direction, position, velocity are useful to describe movement and physics and such.
Sounds like just semantics. I think you might be overthinking the concept if you understand vectors, cross products, and dot products (and other basic ideas in linear algebra). These are super, SUPER basic ideas, so if they are confusing you then you're probably thinking about them the wrong way.
Again just to make it clear. EVERY 3D game will use vectors that represent forward, up, right, direction, position, velocity, acceleration, etc. These are just terms to describe what a particular vector is trying to describe. Unless I missed something, there aren't "two approaches" here.
Don't even think about vectors as "a direction and a magnitude," that idea will be limiting and it conveys them as being special in a sense. Really, the best way to think about it is that a vector is just a number. (Sure it's actually 3 numbers, but just think of it as a bloated "number".) So a vector *could* be used to describe a point, or a direction, or a direction and a magnitude, but that's giving them special meaning. It just happens that in a 3d world, it's convenient to use 3 numbers at a time to describe things. That's really all there is to it.
(Tangential side note: In higher mathematics, they are useful because often you want to describe things in higher dimensional space or even ndimensional space, meaning that you don't define whether the problem lies in 1D, 2D, 3D, 12,345D. To grasp these concepts, you'll have to "unlearn" that stuff about "directions" and "magnitude" if you've internalized it too much.)
Edited by PolaristHelixirr 141
You're talking about different concepts.
Practically every 3d game will find a use for forward, up, and right vectors. But they also need direction, position, velocity vectors for each entity.
In the context of the video, forward, up and, right are are constantly changing (as opposed to most games which can hardcode "up" to an arrow pointing along the positive y axis, meaning that only forward and right are changing.) The three directions are a basic inputs used, among other things, to orient the player and to orient the camera (set up a "view matrix" and "projection matrix"). Their optimization was that in a spherical world, the up vector could be calculated simply by taking the position of the player and subtracting the center of the world. This makes it cheap to calculate the right vector. This is compared to a more general approach of finding the normal vector that corresponds to the polygon that you're standing on (the collision approach he describes as super expensive).
I watched the entire video (thanks, it was interesting), but they did not compare forward, up, right to direction, position, velocity, directly. They are not competing concepts. Defining forward, up, and right are useful constructs to describe orientation, in general. Where as direction, position, velocity are useful to describe movement and physics and such.
Sounds like just semantics. I think you might be overthinking the concept if you understand vectors, cross products, and dot products (and other basic ideas in linear algebra).
This is the kind of reply I was looking for! Thank you, Polaris! I finally understand this, maybe not everything, but this post surely made my day! Useful reference.
PS: No advertising or anything, but I also recommend you all to check out all the other episodes from the developer commentary as well. That way it is easier to get a better picture of game development process.
Polarist 172
This is the kind of reply I was looking for! Thank you, Polaris!
You're welcome. I edited the original post to add more detail. (I may have veered a bit off track though. )
Feel free to add more or PM me if you have any further questions.
Helixirr 141
This is the kind of reply I was looking for! Thank you, Polaris!
You're welcome. I edited the original post to add more detail. (I may have veered a bit off track though. )
Feel free to add more or PM me if you have any further questions.
Thanks for the PM offer, but I prefer discussing subjects on the forums, so that everyone can see them. Helpful resources should belong to everyone.
alh420 5995
In fact, forward, right and up vector is so basic for defining an orientation, that you can put them directly into the columns of a matrix, and you have a rotation matrix that transforms your points into the orientation.
Edited by Olof HedmanHelixirr 141
In fact, forward, right and up vector is so basic for defining an orientation, that you can put them directly into the columns of a matrix, and you have a rotation matrix that transforms your points into the orientation.
Oh, interesting. Thank you for pointing that out.
No wonder they used these vectors in Ratchet and Clank 3, then.
BCullis 1955
Really, the best way to think about it is that a vector is just a number. (Sure it's actually 3 numbers, but just think of it as a bloated "number".) So a vector *could* be used to describe a point, or a direction, or a direction and a magnitude, but that's giving them special meaning. It just happens that in a 3d world, it's convenient to use 3 numbers at a time to describe things. That's really all there is to it.
QFE!
My camera needs a contextual Up, Left, and Forward, as do my character controls. Physics calculations want to know positions, surface normals, incoming direction and magnitude, etc. They're all represented by three values corresponding to a gamespace X, Y, and Zaxis, but in some contexts the numbers are purely positional, and in others (usually interactions as opposed to identities) they represent distances or velocities.

Advertisement
Vectors are objects that can be added, subtracted and multiplied by numbers (scaled). They can represent a large variety of things, but a couple of relevant ones in this context are velocities and translations.
In a 3dimensional vector space, you can pick three vectors (like "forward", "right" and "up") and express any vector as a linear combination of those three. "Linear combination" means an expression like C1*forward + C2*right + C3*up, where C1, C2 and C3 are real numbers. The three vectors are said to be a basis of the vector space.
The problems that arise when you handle curved space using vectors in a naive way are probably the result of trying to use affine geometry where differential geometry should be used.
Share this post
Link to post
Share on other sites