Page 4 of 6

Re: L3D - The Starts of a 3D Lib

Posted: Thu Oct 18, 2012 10:52 am
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)

Re: L3D - The Starts of a 3D Lib

Posted: Thu Oct 18, 2012 11:28 am
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.

Re: L3D - The Starts of a 3D Lib

Posted: Thu Oct 18, 2012 12:06 pm
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

Re: L3D - The Starts of a 3D Lib

Posted: Thu Oct 18, 2012 12:14 pm
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.

Re: L3D - The Starts of a 3D Lib

Posted: Thu Oct 18, 2012 12:19 pm
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.

Re: L3D - The Starts of a 3D Lib

Posted: Thu Oct 18, 2012 9:12 pm
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

Re: L3D - The Starts of a 3D Lib

Posted: Fri Oct 19, 2012 6:55 am
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).

Re: L3D - The Starts of a 3D Lib

Posted: Fri Oct 19, 2012 3:45 pm
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"

Re: L3D - The Starts of a 3D Lib

Posted: Fri Oct 19, 2012 6:21 pm
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.

Re: L3D - The Starts of a 3D Lib

Posted: Wed Oct 24, 2012 1:30 am
by substitute541
Is this project still on?