# Visualizing a vector3

## Recommended Posts

I don't know if some other people here have little difficulty to visualize what is a vector in 3d space, but I had to help myself so as to set directionnalLight direction, which is a vector3 value.

So I set this little playground and I put it here if this can help others

It may be useful to help orient a camera, a directionnalLight, and whatever.

##### Share on other sites

Cooool!  I got a pebble here somewhere... where is that thing?  It's a magic pebble, and ya rub it... and it does... um... light.setDirectionToTarget(some.position [vec3]).  (sometimes useful)

I know your direction vector pain, V-man!    Been there, sweated that sweat, said those dirty words.  heh.  Direction vectors have magnitude, too... and if you increase the magnitude... the direction stays the same... it's just POINTING HARDER!  haha!  God, that's funny, but correct.

Then if ya normalize one of them puppies, it sets all three magnitude levels.... to values between -1 and +1, and then... it STILL points the same way, except.... whimpy pointing.  ROFL!!!

Ahh, directionVectors and magnitudes... the most evil things to ever walk the planet... except for Quaternions.

Cool playground, thanks V!  Well done.

##### Share on other sites

Had a little fun.  Changed to a 2-vector system, and then used those 2 directions (direction1 and direction2) on a zero-gravity particleSystem with custom updater func... to make the particles sparkle.  Good times.

##### Share on other sites

Other option: using the RayHelper

##### Share on other sites

Very nice... good idea.

In this one... I increase the "magnitude" substantially.  I would like to "convert" that magnitude... to ray.length.

Likely, there is no "standard" for length-to-magnitudeValue ratio.  A ray with non-normalized direction of (-10, 0, 100) does not necessarily extend-to worldspace position (-10, 0, 100).  We are free to set ANY ray.length-to-magnitude we wish, yes?  (anyone, not nec DK).

But, for the sake of experimentation, would anyone like to help me do a formula... so ray.length DOES align 1-to-1 with worldspace?  (ray-line actually ends at -10, 0, 100 because ray.length is "bound" to direction magnitude).

ray.length = direction.divide(new BABYLON.Vector3(.1, .1, .1))  ??  Nah, that's not even close.  hmm.  Syncing/binding magnitude to a ray.length.

["Why, Wingnut, why?  It will just confuse you even more!"]

Is the magnitude of a direction vector... its volume control?  Its pointing intensity?  Perhaps I have worked-with the first arg of applyImpulse()... too often, huh?  In THAT case, the magnitude of the directionVector == thrust power.

But, for lights that use direction... the magnitude of that direction COULD BE used to set light.range, right?  Yuh yuh yuh, I think it COULD be so, if wanted.  Arrow Scaling 101.  heh

##### Share on other sites

I like the RayHelper.

Wingnut you're crazy

##### Share on other sites

hehe.  Oh man, could I tell you a story... about Wingnut and "arrows"!

I did some freelance research... into societal herding tendencies.  At first, I was trying to determine what factors affected people joining orgs, such as religions and capitalism.  And I studied what made something... "normal".  People tended to herd towards "normal".  That was the primary arrow/direction that they followed.  The amount of fanaticism they follow anything-with... is the arrow's magnitude.  Wow, huh?  How hard... how powerfully... does the arrow point?

It seemed... folks also follow stories/storytellers (evident with TV/movie/child-stories popularity).  The better the storyteller (the prettier and higher-magnitude the arrow - Disney/Pixar/ILM/LucasArts), the more people follow the arrow (drawn-into, attracted-to).

Then, I noticed that there were four basic types of people, as far as arrows were concerned:

2.  People who install/magnify arrows.
3.  People who take-apart arrows to see what makes them point.    (rare)
4.  People who completely ignore arrows  (rebels/rogues) - rarely care about being/seeking "normal" - often take arrow.negate() route... just to piss-off arrow installers and go-against societal directional expectations.  Deviants... deviating from societal norms.

Arrow Ops 101 - Directioning and Magnituding.  heh.  Hoopla generating.  Enthusiators (peddling/advertising).

Remember C3PO storytelling to the Ewoks on the forest moon of Endor?  Cool.  They were all mesmerized with enthrall.  Drooling.

It's a gruesome subject to study.  Be afraid... be very afraid.  Humans LOVE following stories/arrows.  It's built into our brains, for some reason.  The study of THAT... could take a lifetime.

What the hell were we talking about here?  Oh yeah, direction vectors.  erf.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.