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

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 )

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:

Current gl-alike commands:

Code: Select all

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

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

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 .
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 )
## 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
glove_2.love
updated gLöve
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 )

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

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

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

Crazy stuff!

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

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

Wow.
That's...

Wow.

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

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 )

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? Like some small cars, houses, etc.

Pic:
Attachments
glove_obj.love
gLöve with wavefront obj loader :P
Last edited by Borsty on Thu Nov 20, 2008 5:46 pm, edited 1 time in total.

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

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

Oh my gosh.

+ 100 LÖVE.

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

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

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

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 )

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)

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 )

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
Will push it to it's limits on my desktop pc tomorrow.

With low poly I mean really low poly 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.

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 )

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

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

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
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

For those who're interested, here's a new .love for ya
Attachments
glove_obj2.love
gLöve .obj version 2