Crapadilla
![]() |
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. ![]() Any recommendations? --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||||
Posted: November 21, 2011 1:07 pm | ||||||
Sphinx.
![]() |
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..
|
|||||
Posted: November 21, 2011 1:16 pm | ||||||
Crapadilla
![]() |
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* ![]() ![]() --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||||
Posted: November 24, 2011 4:39 am | ||||||
Sphinx.
![]() |
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 |
|||||
Posted: November 24, 2011 5:22 am | ||||||
Crapadilla
![]() |
Excellent!
![]() --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|||||
Posted: November 25, 2011 4:28 am | ||||||
SpaceRay
![]() |
![]() ![]() Could you explain what use can this have please? |
|||||
Posted: February 18, 2012 2:47 am | ||||||
Morgantao
![]() |
Yeah, what he said ![]() I know I want to see vectors in FF, that would be super cool, but what do you mean by "vector functions"? |
|||||
Posted: February 18, 2012 12:45 pm | ||||||
SpaceRay
![]() |
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
|
|||||
Posted: February 18, 2012 1:11 pm | ||||||
Sphinx.
![]() |
||||||
Posted: February 21, 2012 6:19 am | ||||||
Morgantao
![]() |
I know what Vector is:
It's a mathematical term. A quantity represented by an arrow with both direction and magnitude! ![]() OH YEAH! ![]() |
|||||
Posted: February 21, 2012 1:11 pm | ||||||
Darrell Plank |
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 |
|||||
Posted: March 22, 2012 8:21 pm | ||||||
ThreeDee
![]() |
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. |
|||||
Posted: April 11, 2012 10:26 am | ||||||
Morgantao
![]() |
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.... ![]() |
|||||
Posted: April 12, 2012 2:56 am |
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!
29 unregistered users.