Jump to content

Visualizing a vector3


V!nc3r
 Share

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 :)

http://www.babylonjs-playground.com/#HEACG9#2

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

Link to comment
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.

Link to comment
Share on other sites

Very nice... good idea.

http://www.babylonjs-playground.com/#HEACG9#7

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!"]  :D

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

Link to comment
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:

1.  People who follow arrows.
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).  :D 

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.  :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...