3D Polygon Rendering Engine!

Showcase your libraries, tools and other projects that help your fellow love users.
arundel
Prole
Posts: 31
Joined: Tue Sep 21, 2010 8:49 pm
Location: The Netherlands

3D Polygon Rendering Engine!

Post by arundel »

I've seen that this had been done countless times; on youtube I've seen some demo's and on the löve forums were some cool demo's too of applications able to render 3D stuff, but rarely was it possible to look in all directions and fly anywhere you want with those engines. Mine can. :3
I was planning on making 3D games with it, but I didn't want them to be untextured. And like I've read a lot, and all of ya probably know, textured polygons aren't supported (yes, you can make them, but they need to be preloaded in a canvas/whatever and can't be skewed according to perspective and depth. A real game needs perspective correct textures that change in real time, and unfortunately, that's not really what löve can do). I'm not gonna plot pixel by pixel textures. First of all, that would be affine textures, so not really usefull. Secondly, it's too memmory expensive.

Okay, so I got around 10 FPS with +3000 triangles. Z-indexing does work, but polygons that are "too large" and who's vertices aren't in your field of view will end up with vertices being rendered in the wrong spot on your screen. The engine can directly load models that were made in modelling software by providing polygon vertices. The polygons are collored according to the lighting matrix, which is a vector. I could give a lot of details, but it's all inside the code, which I'm not giving out at the moment.. It's unfinished (srsly, it's not the kind of excuse I'd like to use). Please don't be mad that I come here without giving a demo.
I need suggestions, or ideas of what I could do with this (possibly to improve it). Ask me for details about the engine and coding, I'll be happy to answer. :D

Video with demo:

[youtube]http://www.youtube.com/watch?v=kXWboA5JVYI[/youtube]

Example helicopter (3000+ polygons):
helicopter
helicopter
Love 3D renderer heli.png (39.62 KiB) Viewed 5291 times
Gas station or something (8900 polygons):
gas station
gas station
Love 3D renderer gas station.png (202.74 KiB) Viewed 5278 times
Yay. I'm not good at typing forum posts with scructure. But I do love coding :3
Last edited by arundel on Thu Dec 27, 2012 5:42 pm, edited 1 time in total.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: 3D Polygon Rendering Engine!

Post by Roland_Yonaba »

Oh my -.
That looks awesome...
Are you willing to post a *.love file, by any chance ?
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: 3D Polygon Rendering Engine!

Post by Jasoco »

Competition. Doesn't scare me.
10$man
Citizen
Posts: 77
Joined: Sun Apr 22, 2012 10:40 pm

Re: 3D Polygon Rendering Engine!

Post by 10$man »

Wonderful work :)
I'm looking forward to testing this out!
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: 3D Polygon Rendering Engine!

Post by Roland_Yonaba »

Jasoco wrote:Competition. Doesn't scare me.
Well, you should. :awesome:
Cause actually, I don't know what's going on, but it seems lots of people are diving into simulating 3D. Or 2.5D.
User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: 3D Polygon Rendering Engine!

Post by mickeyjm »

That looks really awesome, but judging by the 3 fps hiding in the second image i dont think it will be able to become anything more than Proof of Concept :(
Your screen is very zoomed in...
arundel
Prole
Posts: 31
Joined: Tue Sep 21, 2010 8:49 pm
Location: The Netherlands

Re: 3D Polygon Rendering Engine!

Post by arundel »

Jasoco wrote:Competition. Doesn't scare me.
The more people reading about 3D graphics and sharing their 3D projects, the easier it will become to improve one another's stuff (and your own) due to the the knowledge made available, and it may inspire some. :D
Btw, Jasoco, I like your 3d projects. It does inspire me. :3 But also when looking at other 3d renderers that folks over here have made and how they bypassed all kinds of limitations that the 2d framework had, it makes me think about alternatives in order to bypass those.
mickeyjm wrote:That looks really awesome, but judging by the 3 fps hiding in the second image i dont think it will be able to become anything more than Proof of Concept :(
It does show prove of concept and I know that it has been done before countless times. I was planning on making small games with it, but I think that the engine needs to be improved first (both mine and Löve itself).
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: 3D Polygon Rendering Engine!

Post by Roland_Yonaba »

That gas station....
Seriously, man, that is just...mindblowing :)

Out of the engine itself, how did you model those scenes, btw ? I mean, how you got coordinates for the set of triangles.
User avatar
slime
Solid Snayke
Posts: 3134
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: 3D Polygon Rendering Engine!

Post by slime »

arundel wrote:
Jasoco wrote:Competition. Doesn't scare me.
I was planning on making small games with it, but I think that the engine needs to be improved first (both mine and Löve itself).
LÖVE is intentionally designed to work specifically with 2D games. Making it work better with either a software/'non-native' 3D implementation or providing API functionality to make 'native' 3D rendering possible won't be improving LÖVE itself, unless the changes directly benefit LÖVE's API for 2D use cases.
Last edited by slime on Fri Dec 28, 2012 8:45 pm, edited 1 time in total.
arundel
Prole
Posts: 31
Joined: Tue Sep 21, 2010 8:49 pm
Location: The Netherlands

Re: 3D Polygon Rendering Engine!

Post by arundel »

@slime,
yeah, löve stays a 2d engine after all. I didn't mean that I needed support for 3d, because as you can see, that's already possible. You can call it pseudo 3d, or the hacky way to use a 2d engine, but it works and I like the outcome. It's more the built-in functions I really need in the future, like texture support with triangles and such (so not static images loaded in canvases, because you know, a scene can be static but the camera moves constantly and so each pixel in a texture needs to be updated according to camera orientation and vertex positions, etc.)

@Roland_Yonaba,
I convert the coordinates from a .3ds or simillar file to something like:
{{0,0,0},{0,0,0},{0,0,0}}
First subtable is a vertex coord, second one is a texture coord, third one too I think.
To scale the mesh, you just have to multiply each vertex's x,y or z by a scale factor. When you do that to all vertices, the vertices move away from the mesh's origin and it will scale up.
The mesh can have all kinds of properties like transparency, visibility, matrix orientation (position and rotation), color, polygons (obviously), staticity, mode, fill, texture (work in progress), etc.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 56 guests