Data Realms Fan Forums
http://forums.datarealms.com/

Vectors
http://forums.datarealms.com/viewtopic.php?f=73&t=46192
Page 1 of 1

Author:  Hoovytaurus [ Fri Aug 04, 2017 12:17 am ]
Post subject:  Vectors

Any full documentation out there on how vectors and velocities work in lua?

I know about nothing except that the variables Pos and Velocity are a thing. That exist. And have values.

I've gone about a bit and while every code seems to use some form of advanced vector/velocity trickery nowhere is it actually, step-by-step explained. If any of you can prove me wrong on that, that'd be awesome.

Author:  Bad Boy [ Thu Aug 10, 2017 4:39 am ]
Post subject:  Re: Vectors

What're you trying to understand? They're pretty standard 2d vectors - they have two number values, the first being X value which describes their horizontal component, and the second being their Y value which describes their vertical component. For position vectors, (0, 0) is at the top left of the screen if I'm not mistaken, and x increases as things go right while y increases as things go down. For things like velocities, the size of the numbers describes the speed of the velocity vector in each of the aforementioned directions, so a positive x would mean it's describing something moving right at some speed. Keep in mind that both of these things are the same vectors, what matters is how you interpret their values.

If it'll help you any, there's a wiki page for it which probably tells you most everything you can do with them:
http://wiki.datarealms.com/LuaDocs/Vector

If you're still confused, I'd recommend googling for Vector tutorials, even if the specifics differ, they'll be much the same as CC vectors. For example, here's a unity one that's probably straightforward:
https://unity3d.com/learn/tutorials/top ... ctor-maths

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/