View unanswered posts | View active topics It is currently Tue Mar 19, 2024 4:50 am



Reply to topic  [ 2 posts ] 
 Vectors 
Author Message

Joined: Mon Dec 21, 2015 9:30 am
Posts: 89
Reply with quote
Post 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.


Fri Aug 04, 2017 12:17 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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


Thu Aug 10, 2017 4:39 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.254s | 15 Queries | GZIP : Off ]