L3D - The Starts of a 3D Lib

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: L3D - The Starts of a 3D Lib

Post by Nixola »

I think the problem is not the bad loading, but the bad drawing; I encountered a similar problem (I han only one cube, though) when trying to make a cube (drawn by Sobstitute's library) only show its visible faces, I had to check the order in which the points are given to love.graphics.polygon (I didn't check your code, but since the problem is similar I think the solution may also be the same)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: L3D - The Starts of a 3D Lib

Post by substitute541 »

Nixola wrote:I think the problem is not the bad loading, but the bad drawing; I encountered a similar problem (I han only one cube, though) when trying to make a cube (drawn by Sobstitute's library) only show its visible faces, I had to check the order in which the points are given to love.graphics.polygon (I didn't check your code, but since the problem is similar I think the solution may also be the same)
... Erm, which library are you talking about. I'm getting a bit confused.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: L3D - The Starts of a 3D Lib

Post by Nixola »

viewtopic.php?f=5&t=10777&start=20#p66223

I had some problems with the attached .love because I wasn't giving the points to love.graphics.polygon in the right order, achieving an effect similar to 10$Man's last demo

P.S: Ok, it's not a library but I didn't remember what it was exactly
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: L3D - The Starts of a 3D Lib

Post by substitute541 »

Nixola wrote:viewtopic.php?f=5&t=10777&start=20#p66223

I had some problems with the attached .love because I wasn't giving the points to love.graphics.polygon in the right order, achieving an effect similar to 10$Man's last demo

P.S: Ok, it's not a library but I didn't remember what it was exactly
... Why don't we talk this either in the IRC channel, or Skype? (BTW, it's night here so, I will probably be sleeping by the time you reply. Skype username is substitute541).

I am still confused, but if you mean random glitches that occur when points are placed in the wrong order, try placing the points clockwise/counter-clockwise.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: L3D - The Starts of a 3D Lib

Post by Nixola »

I didn't explain well, I think.
I made that demo starting from the one in which you only see the 8 points; when I started writing the bit of code that draws the cube's faces, I encountered a problem that was caused by giving points to lg.polygon in the wrong order, I solved that problem before uploading it. Anyway, 10$Man's cubes are drawn as if he has the same problem I had.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
10$man
Citizen
Posts: 77
Joined: Sun Apr 22, 2012 10:40 pm

Re: L3D - The Starts of a 3D Lib

Post by 10$man »

Nixola wrote:I didn't explain well, I think.
I made that demo starting from the one in which you only see the 8 points; when I started writing the bit of code that draws the cube's faces, I encountered a problem that was caused by giving points to lg.polygon in the wrong order, I solved that problem before uploading it. Anyway, 10$Man's cubes are drawn as if he has the same problem I had.
The thing is, it is pretty hard to change it as everything is loaded from a .obj.
The problem with this is that, it is harder to change around a specific value then if everything was just in arrays that could easily be manipulated (or at least they don't start in an array).
I know the problem is not drawing order (Though I'm sure this is a problem too), it's in the loader. (I know because I programmed it :) )
Thank you for the suggestion though
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: L3D - The Starts of a 3D Lib

Post by substitute541 »

... Now I know what Nixola's problem was. Z-Sorting.

Yep, 10$Man's cubes looks like he had that problem. Implementing z-sorting is easy, and there are 2 techniques. First one, which Nixola used before in my original Love3D, was to run a loop that runs at the FACES table, look at each face for how many vertices it has, take the average of those vertices, then, at the outside of the loop, sort the table according to their avg vertices. Second method is similar, only you take the minimum Z. Both of them work, but average Z works best with some culling (I use backface culling).
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: L3D - The Starts of a 3D Lib

Post by qaisjp »

Good work, looks hawt.

I should say that it won't really be a good 3D lib if you can't control the camera position (x, y, z) and camera lookat (x, y, z)

^z
| /y
|/
x---->

thats the x,y,z in 3d space afaik. I guess x,y looks normal from top down, and a higher z is "closer to the camera from a top-down position"
Lua is not an acronym.
10$man
Citizen
Posts: 77
Joined: Sun Apr 22, 2012 10:40 pm

Re: L3D - The Starts of a 3D Lib

Post by 10$man »

qaisjp wrote:Good work, looks hawt.

I should say that it won't really be a good 3D lib if you can't control the camera position (x, y, z) and camera lookat (x, y, z)

^z
| /y
|/
x---->

thats the x,y,z in 3d space afaik. I guess x,y looks normal from top down, and a higher z is "closer to the camera from a top-down position"
What if I challenged your statement with "you won't really be a good 3d programmer unless you understand how rotations work?"
Of course, I wouldn't say that.
Views and camera positions are relatively easy to control from the translate and rotate functions. It should, in theory, work exactly how openGL works. I'll try to make a fps example so you can see.
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: L3D - The Starts of a 3D Lib

Post by substitute541 »

Is this project still on?
Currently designing themes for WordPress.

Sometimes lurks around the forum.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 7 guests