Page 4 of 4

Re: Love3D

Posted: Mon Dec 03, 2012 7:44 am
by DMAshura
I'm getting pretty good frame rates in general, but I've got a different question ... what's the best way for me to decide which objects are in front of others and still have it draw at a decent framerate? I noticed in my demo if I put polygon drawing and ring drawing in the same for loop, it's slow, but if I do rings separately it's much faster ... but this won't help me if later on I want some polys to be drawn in front of rings.

Anyway, you can move around using left, right, up, down, w, and s. Though ... weird things happen when you move forward enough...

Re: Love3D

Posted: Wed Dec 05, 2012 8:52 am
by substitute541
DMAshura wrote:I'm getting pretty good frame rates in general, but I've got a different question ... what's the best way for me to decide which objects are in front of others and still have it draw at a decent framerate? I noticed in my demo if I put polygon drawing and ring drawing in the same for loop, it's slow, but if I do rings separately it's much faster ... but this won't help me if later on I want some polys to be drawn in front of rings.

Anyway, you can move around using left, right, up, down, w, and s. Though ... weird things happen when you move forward enough...

It's best to post here. I am assuming that DM is using my lib. The poly thing is easy, just change the zsorttriangle functions to use with other polys (add more z positions to the getAvg function; it supports an infinite amount of arguments).

Re: Love3D

Posted: Thu Dec 06, 2012 1:36 am
by Jasoco
As someone who has also been experimenting with 3D a lot, it's best to use table.sort to sort all objects by their distance from the "camera". This includes all triangles as well as sprites.

And in your Sonic prototype I notice you need to also make it not show objects that are behind the camera. Otherwise you get that weird "objects on the ceiling moving away" look.

Re: Love3D

Posted: Thu Dec 06, 2012 6:54 am
by Codex
900 FPS on the last demo. I might dabble in 3D in a year or two, so I'm looking forward to seeing what you can come up with in the meantime!

Re: Love3D

Posted: Fri Dec 07, 2012 2:16 am
by substitute541
Jasoco wrote: And in your Sonic prototype I notice you need to also make it not show objects that are behind the camera. Otherwise you get that weird "objects on the ceiling moving away" look.
That is the effect of the calculation I made :

Code: Select all

scale = fl/(fl + z)
So for z = -fl, the scale becomes infinite, then for z < -fl, it inverts.

Re: Love3D

Posted: Sat Jan 05, 2013 2:20 pm
by Darky
more sonic 3d stuff plz ! :D