2D Perspective Camera

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Parameterized
Prole
Posts: 8
Joined: Mon Sep 08, 2014 2:18 pm

2D Perspective Camera

Post by Parameterized »

I've created a controllable 2D perspective camera using the method described here

It has some odd problems with jitter, so if anyone wants to dissect it and help me find the problem that would be helpful.
Also, if you have something you would like to see me add/change please leave a comment.
Attachments
2D Perspective Camera.love
(3.42 KiB) Downloaded 416 times
Last edited by Parameterized on Mon Sep 08, 2014 4:19 pm, edited 1 time in total.
User avatar
Rucikir
Party member
Posts: 129
Joined: Tue Nov 05, 2013 6:33 pm

Re: 2D Perspective Camera

Post by Rucikir »

This is nice ! but you should increase the field of vision, I mean the two sides of the blue triangle in front of the character to better match what is rendered in perspective, because I have the feeling that there are more quads rendered in perspective than points in the triangle.
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: 2D Perspective Camera

Post by Zilarrezko »

^^ Very nice work man. Wish I could learn by reading.
User avatar
Parameterized
Prole
Posts: 8
Joined: Mon Sep 08, 2014 2:18 pm

Re: 2D Perspective Camera

Post by Parameterized »

Rucikir wrote:This is nice ! but you should increase the field of vision, I mean the two sides of the blue triangle in front of the character to better match what is rendered in perspective, because I have the feeling that there are more quads rendered in perspective than points in the triangle.
Right now I'm taking 1024 samples of the scene and displaying those on the bottom with each one taking up 0.75 pixels. That's probably way too much considering its even less than 1/pixel but having a high resolution lets you see past some pixels where you would normally stop at the one in front. I do have a field of view variable, and in the file it's set to 60, but it could be easily changed if you need it to be. Here's a picture with more FOV and less resolution (plus some debug lines for the rays and which pixels it takes).
Image
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests