Proof of concept: Löve3d( or gLöve :P )

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Proof of concept: Löve3d( or gLöve :P )

Post by Borsty » Wed Nov 19, 2008 10:44 pm

Another project I'm working on is adding basic 3d functionality to Löve. It's basically just a proof of concept because I wanted to check how all the 3d to 2d transformation stuff is done. The functions are close to basic openGl, what's implemented yet is translation, rotation, scaling, basic lights, backface culling and matrix push and pop'ing. Functions to position text in 3d space are also available.

Here are some screenshots:

Image
Image

Current gl-alike commands:

Code: Select all

glSet( setting, val )
glGet( setting )
glEnable( setting )
glDisable( setting )
glGetMatrix()

glPush() / glPushMatrix()
glPop() / glPopMatrix()

glLoadIdentity()
glTransform( a, b, c ) / glTranslate( a, b, c )
glRotate( a, b, c, d )
glScale( a, b ,c )

glVertex( x, y, z )
glColor( r, g, b, a )
glString( pos, text, cl )

glBegin( type )
glEnd()
glFlush()
I still need to fix some stuff and add more possibilities.
What's semi-done is frustrum culling which should fix some drawing errors with stuff that's off screen but still gets rendered.

Here's the .love for you to play around or take a look how it's done and maybe you can find a better solution for something :P.
Camera movement is wasd and the arrow keys, but notice that it's bugged, still working on it.
glove.love
gLöve ( or Löve3d )
(16.75 KiB) Downloaded 651 times
## Update ##
The camera movement was bugged because I accidently changed the order of matrix multiplications, which fucked up the result :C
Here's the fixed one :P
glove_2.love
updated gLöve
(16.75 KiB) Downloaded 909 times
Last edited by Borsty on Thu Nov 20, 2008 3:44 pm, edited 2 times in total.

Ripe
Prole
Posts: 11
Joined: Wed Nov 19, 2008 3:28 pm
Location: Australia

Re: Proof of concept: Löve3d( or gLöve :P )

Post by Ripe » Thu Nov 20, 2008 3:10 am

Cool! This thing just keeps getting more and more interesting.

User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Proof of concept: Löve3d( or gLöve :P )

Post by rude » Thu Nov 20, 2008 7:56 am

Crazy stuff!

User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Proof of concept: Löve3d( or gLöve :P )

Post by mike » Thu Nov 20, 2008 10:23 am

Wow.
That's...

Wow.


PROTIP: I am amazed.
Now posting IN STEREO (where available)

User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: Proof of concept: Löve3d( or gLöve :P )

Post by Borsty » Thu Nov 20, 2008 3:50 pm

Wrote a wavefront .obj model loader today. But you can't find any good low poly models on the web when you need some :C
Anyone here to make some very basic .obj models without textures etc? :P Like some small cars, houses, etc.

Pic:
Image
Attachments
glove_obj.love
gLöve with wavefront obj loader :P
(21.46 KiB) Downloaded 400 times
Last edited by Borsty on Thu Nov 20, 2008 5:46 pm, edited 1 time in total.

User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: Proof of concept: Löve3d( or gLöve :P )

Post by Kuromeku » Thu Nov 20, 2008 4:02 pm

Oh my gosh.

+ 100 LÖVE.

User avatar
Kuromeku
Party member
Posts: 166
Joined: Sun Jul 20, 2008 5:45 pm

Re: Proof of concept: Löve3d( or gLöve :P )

Post by Kuromeku » Thu Nov 20, 2008 4:04 pm

Wow. How limited will this be? What's the best you'll be able to do?

User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Proof of concept: Löve3d( or gLöve :P )

Post by qubodup » Thu Nov 20, 2008 4:26 pm

Borsty wrote:But you can't find any good low poly models on the web when you need some :C
Get the packs from the right side bar of LPC. Or look for specific ones on their forums.

PS: I think it looks like a neat toy. But probably not usable for 3D games, though probably usable for some super-special scenes in 2d games..

PPS: lua 3D I know of would be Lugre.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)

User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: Proof of concept: Löve3d( or gLöve :P )

Post by Borsty » Thu Nov 20, 2008 4:51 pm

Kudomiku wrote:Wow. How limited will this be? What's the best you'll be able to do?
Well, on my notebook I ran into low framerates when getting over like 100 polygons.
A 3000 poly model ran at like 0.3 fps.
But that's a 4 years old 1.5 GHz centrino thingy with a geforce 6200 go, nothing you could call a gaming machine :P
Will push it to it's limits on my desktop pc tomorrow.

With low poly I mean really low poly :P when I got the frustrum culling added to increase the performance a little I'll write a small gta alike game, so only buildings are "3d", maybe the cars too, dunno.

User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: Proof of concept: Löve3d( or gLöve :P )

Post by Borsty » Thu Nov 20, 2008 7:57 pm

Hmmm... double post? Meh, time has passed :P

Anyway, I rewrote the .obj parser, it now supports groups and materials ( only reads the color but at least it does :D )

Image
Here's a pic of a small car I made, now the biggest issue is the lack of a zBuffer that could stop the wheels from being drawn.... wierdly :P
Maybe I can fix that with tweaking the model a little :/
Another thing is the *not the most accurate* way of calculating the brightness of a face. Could be fixed easily but lowers the fps once more.

Löve just isn't made for this :P

For those who're interested, here's a new .love for ya :P
Attachments
glove_obj2.love
gLöve .obj version 2
(24.36 KiB) Downloaded 477 times

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests