Shaded cube

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Shaded cube

Post by S-Rave »

So I was making this rotated cube in wireframe.

Then I filled it.

Then I culled the back faces.

Now I added shading.

Though I think I've done something wrong with the shading algoritm. Well it's more like I KNOW I've made something wrong with it. And maybe I should have used quads instead of triangles so the shading wouldn't look so weird. :)
Just thought I'd share. (oh yeah, thanks osgeld for the help a few days ago :) )


Edit: Fixd shading problem. If anyone wants to edit, use or whatever you're welcome to! :)
Attachments
ShadedcubeCorrectQuad.love
Shading like a quad instead of a ... well. Triangle?
(2.4 KiB) Downloaded 267 times
shadedcube.love
(2.3 KiB) Downloaded 247 times
srejv
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: Shaded cube

Post by Skofo »

Woo cubes! :ultraglee:

I don't know how you guys can do this 3D stuff. I could never wrap my head around it. ^^; Good job!

One thing, though: the faces seem to appear and disappear when they're not quite completely covered by the front faces. Perhaps you need to take the angle of the cube into consideration...
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: Shaded cube

Post by S-Rave »

Yes, I'm aware of that, but it should be fixed in the "correctquad" version. Should does not mean that it is fixed. :ultrashocked:: I think it's more correct now than before anyway :megagrin:
srejv
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: Shaded cube

Post by Skofo »

Naw it is in the corrected one. ;)
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
User avatar
hdon
Prole
Posts: 36
Joined: Tue Mar 17, 2009 10:54 pm
Location: Pittsburgh, PA, USA
Contact:

Re: Shaded cube

Post by hdon »

ROFL

Shame that LOVE refuses to give you access to OpenGL's third dimension!

:cry:

Clever work around!
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: Shaded cube

Post by S-Rave »

It was the work around that was the "project". ;) There is an opengl lib in here somewhere but it's slow.

LÖVE!
srejv
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 9 guests