YOUR ACCOUNT

Login or Register to post new topics or replies
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Super-stupid beginner question:

Are there any super-duper-optimized-and-hence-officially-recommended vector funtions that you guys like to use?

I found some on Rosetta Code, but I'm looking for the 2-dimensional kind. smile;)

Any recommendations?
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Well, I've written a vector class for lua, but the darn errors makes it quite impractical. I'll consider publishing it when I get back to the office..
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Strange that FF does not come with its own lua vector class.

How about implementing something like Lua-Vec?

If one were to believe this benchmark... *hint hint* smile;) smile:D
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Alright, started up a new section in the Wiki... http://filterforge.com/wiki/index.php...ta_classes

I posted my vector "class".. I will post an example on how to use it when I find time
  Details E-Mail
Crapadilla
lvl 52 Filter Weaver and Official "Filter Forge Seer"

Posts: 4365
Filters: 65
Excellent! smile:beer:
--- Crapadilla says: "Damn you, stupid redundant feature requests!" ;)
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
smile:?: sorry this looks like chinese words for me smile:?:

Could you explain what use can this have please?
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Quote
SpaceRay wrote:
sorry this looks like chinese words for me
Could you explain what use can this have please?


Yeah, what he said smile:D

I know I want to see vectors in FF, that would be super cool, but what do you mean by "vector functions"?
  Details E-Mail
SpaceRay
SpaceRay

Posts: 12298
Filters: 35
Quote
Morgantao wrote:

I know I want to see vectors in FF, that would be super cool


YES ! I also want to have vectors inside FF, and Vladimir said that would not be possible for 3.0 as they should change lots of things for this to be available.

BUT I do not think that this thread is about "vectors" in the way we understand and know them.

This is "Vector Class" which looking in google it has nothing to do with the graphic vector

What I mean that it looks like chinese for me is the link that Sphinx have put and that you can here below

Of course that I do not know anything about script, but also do not know what this would be useful in FF


Quote
Sphinx wrote:

I posted my vector "class".. I will post an example on how to use it when I find time
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
I know what Vector is:
It's a mathematical term. A quantity represented by an arrow with both direction and magnitude!



OH YEAH! smile:D
  Details E-Mail
Darrell Plank
Posts: 42
Filters: 4
Not sure what type of vector functions you're thinking of. Rotating a vector, finding it's length, translating it, normalizing it - what else were you thinking of? The formulas for all of these are pretty simple:

Length of vector (x, y): Sqrt(x * x + y * )

Rotating vector (x, y) by angle t: (x * Cos(t) - y * Sin(t), x * Sin(t) + y * Cos(t))

Translate vector(x, y) by vector(tx, ty): (x + tx, y + ty)

Normalize a vector (x, y): (x / length(x, y), y / length(x, y))

Are you thinking of anything else? I guess to give full linear transforms you should be able to scale also -

Scale vector (x, y) by factor s: (x * s, y * s)

Reflect around y axis: (-x, y)

Reflect around x axis: (x, -y)
Darrell
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
As far as I can tell, we are talking about using matrix math to transform (scale, rotate, etc.) (points or) vectors in two or three dimensions.

This is a simplified and faster method of calculating such transformations. The rotation table for 3D vectors certainly look simpler than doing the same trigonometrically.

Now, why we never studied this in school is a mystery to me, but it seems very useful in computer graphics... Hmm, probably exactly for that reason.
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
ThreeDee, you're right.
Vectors are the key to computer graphics. Both 2D and 3D.
In my younger days I studied some of this in college, but I don't remember any of it these days.... smile:(
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,712 Registered Users
+19 new in 30 days!

153,533 Posts
+31 new in 30 days!

15,348 Topics
+73 new in year!

Create an Account

Online Users Last minute:

33 unregistered users.