Page 1 of 2

Zed.lua (3d library)

Posted: Fri May 16, 2014 10:35 pm
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:

Re: Zed.lua (3d library)

Posted: Sat May 17, 2014 2:58 am
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!

Re: Zed.lua (3d library)

Posted: Sat May 17, 2014 6:38 pm
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.

Re: Zed.lua (3d library)

Posted: Sat May 17, 2014 7:53 pm
by jjmafiae
Jasoco wrote:Everyone's doing 3D these days.
im not, am I a traitor?

Re: Zed.lua (3d library)

Posted: Sat May 17, 2014 9:16 pm
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!

Re: Zed.lua (3d library)

Posted: Sun May 18, 2014 3:34 am
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.

Re: Zed.lua (3d library)

Posted: Sun May 18, 2014 9:13 am
by Robin
I think he did. A three-dimensional parade, wasn't it?

Re: Zed.lua (3d library)

Posted: Sun May 18, 2014 11:12 am
by jjmafiae
Well it wasn't real 3D but a 3D like perspective or something.

Re: Zed.lua (3d library)

Posted: Thu May 22, 2014 9:43 pm
by alesan99
Fixed a minor mistake.
Redownload if you're using the library.

Re: Zed.lua (3d library)

Posted: Thu Mar 23, 2017 12:33 pm
by yetneverdone
Bump. Is this library not active anymore?