Zed.lua (3d library)

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
alesan99
Citizen
Posts: 53
Joined: Sun Feb 09, 2014 3:13 am
Contact:

Zed.lua (3d library)

Post by alesan99 »

So I've been making 3d in love since I've seen hugobdesigner's 3d thread.
At first I didn't really wan't to make a 3d lib because people would think I'm crazy for trying to make 3d in a 2d engine instead of using a 3d engine but after I saw oysi's thread I know people like 3d.
So yea, hope you like it.
BIG THANKS TO http://petercollingridge.appspot.com/3D-tutorial
For LOVE 0.9.0/0.9.1
Guide
Here is how to make a simple cube

Code: Select all

function love.load()
   zed = require("zed")
   cube = zed.newCube(0, 0, 0, 50)
   zed.rotateFormX(cube, -.5)
   zed.rotateFormY(cube, -.5)
end

function love.draw()
   love.graphics.translate(love.window.getWidth()/2, love.window.getHeight()/2)
   zed.drawForm(cube, {faces = true, shadows = true})
end
I don't have time to write descriptions for every function.
  • zed.setPointColor(r, g, b, a)
    zed.setEdgeColor(r, g, b, a)
    zed.newCube(x, y, z, facesize)
    zed.newRectangularPrism(x, y, z, width, height, depth)
    zed.newForm(nodes, edges, faces, facecolors)
    zed.setFaceColors(obj, colors)
    zed.setFaceColor(obj, face, color)
    zed.setLightVector(x, y, z)
    zed.getLightVector()
    zed.setCamera(x, y, z)
    zed.getCamera()
    zed.setFOV(fov)
    zed.getFOV()
    zed.drawForm(obj, tasks)
    zed.getNodes(obj)
    zed.getEdges(obj)
    zed.getFaces(obj)
    zed.rotateFormX(obj, theta)
    zed.rotateFormY(obj, theta)
    zed.rotateFormZ(obj, theta)
    zed.rotateForm(obj, thetax, thetay, thetaz)
    zed.getFormRotation(obj)
    zed.translateForm(obj, x, y, z)


Examples
Image
Image
3d 3d Rectangular Prism (cross eye 3d)
Coming soon: simple 3d Physics

Download
I really don't want to cause trouble with licenses so I'll make it simple.
You can edit and/or use it only if you give me and http://petercollingridge.appspot.com/3D-tutorial credit
Download

there's still a lot to do.
I'll add more set and get functions and a drawObjects function (It draws the objects that are in front first)
It's usable, but it doesn't have enough function for a full game.
I would like some tips to make my library better, so if you think something could be improved tell me

Enjoy :nyu:
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Zed.lua (3d library)

Post by Jasoco »

Everyone's doing 3D these days.

In fact, I wanted to do 3D in a 2D engine because people would think I'm crazy. If people didn't think crazy when they shouldn't have, we never would have gotten Star Fox or Donkey Kong Country.

More 3D! More 3D!
LuaWeaver
Party member
Posts: 183
Joined: Wed Mar 02, 2011 11:15 pm
Location: Ohio, USA

Re: Zed.lua (3d library)

Post by LuaWeaver »

I can't do the cross-eyed thing... I'm supposed to cross my eyes until the dots line up in the center, right?

Also, awesome! Thanks for linking that tutorial.
"your actions cause me to infer your ego is the size of three houses" -finley
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Zed.lua (3d library)

Post by jjmafiae »

Jasoco wrote:Everyone's doing 3D these days.
im not, am I a traitor?
User avatar
alesan99
Citizen
Posts: 53
Joined: Sun Feb 09, 2014 3:13 am
Contact:

Re: Zed.lua (3d library)

Post by alesan99 »

LuaWeaver wrote:I can't do the cross-eyed thing... I'm supposed to cross my eyes until the dots line up in the center, right?

Also, awesome! Thanks for linking that tutorial.
Yeah you have to cross your eyes until you only see one dot. If the 3d looks inverted just edit the code so the box rotations are flipped.

thank you!
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Zed.lua (3d library)

Post by Jasoco »

jjmafiae wrote:im not, am I a traitor?
Yes.

Wait, you never did a 3D project here? I can't keep track as they keep popping up so fast.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Zed.lua (3d library)

Post by Robin »

I think he did. A three-dimensional parade, wasn't it?
Help us help you: attach a .love.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: Zed.lua (3d library)

Post by jjmafiae »

Well it wasn't real 3D but a 3D like perspective or something.
User avatar
alesan99
Citizen
Posts: 53
Joined: Sun Feb 09, 2014 3:13 am
Contact:

Re: Zed.lua (3d library)

Post by alesan99 »

Fixed a minor mistake.
Redownload if you're using the library.
User avatar
yetneverdone
Party member
Posts: 446
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Zed.lua (3d library)

Post by yetneverdone »

Bump. Is this library not active anymore?
Post Reply

Who is online

Users browsing this forum: No registered users and 77 guests