brain56
brain56

Reputation: 2711

A vector (0,0,0) faces in what direction?

In OpenGL (LWJGL to be more specific), if the camera's facing direction is defined by the vector (0,0,0), where does it face?

EDIT:

So guys, I've read your comments and answers and I can proudly say that I am far more enlightened now than I was a few hours ago, thanks to you. I can't really point out one correct answer to the question since all of you contributed (in a way), so +1 to all of you! Thanks again.

Oh, and as to why ask the question? It just popped up in my mind while wandering in 3D space and pondering on another problem. :P

Upvotes: 2

Views: 506

Answers (3)

datenwolf
datenwolf

Reputation: 162289

First lets reconsider what actually indroduces such things as "directions" as vector space. Vectors can be anyting, numbers, directions, chairs, colours, tables, you name it. As long as you can define an vector space of linear independent base vectors, it is a vector space.

So we arbitrarily introduce some base vectors, call them "right", "up" and "out" (you may also use arrows, or little whatever), also say that "right" and "up" correspond to columns and rows of out later screen and "out" being the depth buffer value. This gives us a screen space vector space. We now introduce a number of transformations, which transform from something we call "local space" into "eye space" and from "eye space" into "clip space". We also say those transformations are to be isomorphisms. Thus all those spaces are structurally equivalent.

You remember the base vectors? We now define that something like (a, b, c) is in fact a shortcut for writing a "right" + b "up" + c "out". Now keep in mind that something is then part of a vector space if it can be expressed by a linear combination of its base vectors. If you multiply those base vectors with 0 they vanish. So a null vector is not part of any particular vector space whatsoever, but can be expressed in terms of any vector space. It's also said to be singular. Or in other words, if you test a vector if it can not be expressed as part of a particular vector space, a null vector will fit in any vector space.

In the case of the vector space of directions we introduced this means, that for a null vector no direction in particular is defined, but if added to another direction it will not alter it.

You may ask "how the %$@§ does a zero position vector work then?". Well, remember that we can still use null vectors as offsets. We define an arbitrary element as our origin, and add to it.

Also we must differ between 0 (i.e. the multiplicative vanishing) and the digit "0", which may match in a evaluation to 0, but if part of the bitvector representing a number is not vanishing!

Upvotes: 2

Christian Rau
Christian Rau

Reputation: 45948

Nowhere and Everywhere. A camera direction of 0 will most probably lead (by whatever computation) to a singular view transformation, which should just transform every vertex into a singular point (the camera position?). I myself wouldn't call such a view transformation valid, but maybe you have a really obscure application for such a thing.

Upvotes: 1

genpfault
genpfault

Reputation: 52094

A zero-length vector has no direction.

Upvotes: 4

Related Questions