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...
Love3D
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Love3D
- Attachments
-
- sonic3d.love
- (5.33 KiB) Downloaded 117 times
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Love3D
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).
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Love3D
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.
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
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!
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Love3D
That is the effect of the calculation I made :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.
Code: Select all
scale = fl/(fl + z)
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest