Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
February 11, 2012, 01:07:22 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Welcome to PSP-Programming.com
Home Help Search Shop Login Register
Digg This!
Pages: [1]
Print
Author Topic: Start of Lua Matrix and Vector classes  (Read 2213 times)
yaustar
gibbocool rules!
All-Around Dev
Hero Member
*

Karma: +74/-13
Offline Offline

Posts: 523
17011.11 points

View Inventory
Send Money to yaustar


View Profile WWW
« on: December 22, 2006, 02:59:07 PM »

I got bored today (since work let us off early Smile ) and just wanted to make sure that my 3D math is still solid, so I whipped up a base matrix and vector class for Lua with the future possiblity of developing some vector games in Lua. I also wanted to see if Lua could handle all the operations needed for the math natively.

Again, this is proof of concept/tech demo so I may finish this or I may not so I have released this under GPL [ http://www.gnu.org/copyleft/gpl.html ]. Enjoy.

Circle: Strafe right
Square: Strafe left
Up: Forward
Back: Back
Left: Rotate Left
Right: Rotate Right



To newsposters: I highly recommend that this should not be posted on the frontpage as it does not benefit end users. This is just a proof of concept.
Logged



Soulkiller
Miinaturvat Rules!
Hero Member
*****

Karma: +77/-6
Offline Offline

Posts: 1151
83.50 points

View Inventory
Send Money to Soulkiller


View Profile
« Reply #1 on: December 22, 2006, 04:17:01 PM »

very nice! might I recommend making all the vertcorAdd functions add what not memebers of the CVector and CMAtrix tables, that way their functions of the vectors so you could call them like so

Code:
myVector.Add( otherVector )

or is their something I'm missing about metatables
Logged

yaustar
gibbocool rules!
All-Around Dev
Hero Member
*

Karma: +74/-13
Offline Offline

Posts: 523
17011.11 points

View Inventory
Send Money to yaustar


View Profile WWW
« Reply #2 on: December 22, 2006, 04:34:44 PM »

Given Vectors A and B, there are times where you want C = A + B instead of A = A + B so I decided to leave it as a standard function. It is more an opinion on code design so you are not missing anything in metatables Wink.
Logged

Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.31 seconds with 27 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com