Can a fish-eye projection be represented by a 4x4 matrix?
No, the transformation you need for the fish-eye effect is
x' = f * sin(x)
[editline]14th January 2013[/editline]
Maybe you could approximate it with a small number of matrix multiplications, relying on a Taylor expansion of sine
edit: Correction.
x' = f * atan2(x, z)
y' = f * atan2(y, z)
would map local coordinates to a spherical surface.
[QUOTE=ThePuska;39208440]The problem actually is that a high FOV normally does [i]not[/i] cause a fish-eye effect. Normal perspective projection gets ridiculously distorted when theta approaches 180, but that doesn't occur with fish-eye projections. I seem to recall that Dungeon Keeper toyed with high FOVs when you possessed some creatures (flys I think?). I could remember incorrectly though[/QUOTE] Like on gmod when you zoom out with the camera tool, look down and a small pavement truns into a fucking skyscraper. I would get a screenie but linux :( [QUOTE=ThePuska;39208565]No, the transformation you need for the fish-eye effect is x' = f * sin(x) [editline]14th January 2013[/editline] Maybe you could approximate it with a small number of matrix multiplications, relying on a Taylor expansion of sine[/QUOTE] Judging by what I see as I lurk these threads, should I get a better hold of maths before I start learning to program? I'm pretty terrible.
[QUOTE=whatthe;39208742]Judging by what I see as I lurk these threads, should I get a better hold of maths before I start learning to program? I'm pretty terrible.[/QUOTE]
Learn as you need it. You'd be more interested in it that way and math is too big to learn everything while keeping motivation
[QUOTE=WeltEnSTurm;39208475]Can a fish-eye projection be represented by a 4x4 matrix?[/QUOTE]
AFAIK the best way to do the fish-eye effect is to tessellate your geometry and use a vertex shader to do the transformation. I don't think 4x4 matrices can represent that kind of transformation, because they use homogenous coordinates, which always map straight lines to straight lines.
There's also fisheye Quake: [url]http://strlen.com/gfxengine/fisheyequake/compare.html[/url]
[QUOTE=ThePuska;39209074]There's also fisheye Quake: [url]http://strlen.com/gfxengine/fisheyequake/compare.html[/url][/QUOTE]
Yeah, that uses some pretty hacky pixel manipulations which I'm not fond of.
[QUOTE=Mr Kirill;39208406]Today I uploaded [URL="http://www.newgrounds.com/portal/view/609301"]A Bit of Fun to Newgrounds[/URL]!
After even more complaints about slippery controls, I made them super-responsive. Plays better now, in my opinion.[/QUOTE]
You [del]broke the ice[/del] created super glue.
[editline]14th January 2013[/editline]
[QUOTE=Smashmaster;39209090]Yeah, that uses some pretty hacky pixel manipulations which I'm not fond of.[/QUOTE]
I don't think there's another way, if you use a vertex shader the interpolation between vertices would be wrong.
[QUOTE=Tamschi;39209785]I don't think there's another way, if you use a vertex shader the interpolation between vertices would be wrong.[/QUOTE]
Yup, that's why you tessellate first.
so I took my simplex noise thing and I made it output vmfs
from this
[img]http://puu.sh/1Nq17[/img]
to this
[t]http://puu.sh/1N8Wq[/t]
[QUOTE=whatthe;39208255]Guys I hardly know anything of programming, but has anyone a simple FPS engine that they could test an idea.
.......[/QUOTE]
I would think that there would be a maximum angle that would 'look right', and if you went past that no amount of processing could fix it.
Edit:
Whoops. Missed a whole page responding to that. :suicide:
Made some more progress on my game, hopefully now my uni deadlines are out the way I can focus more time into it and make more regular updates :)
[video]http://youtube.com/watch?v=0HI5zMY-nyo[/video]
Started working on a tool in Java that automatically generates smooth brush roads as VMFs.
[IMG]https://dl.dropbox.com/u/17850283/spiralroad1.png[/IMG]
(This is after a lot of manual tweaking, but it's still pretty close.)
[img]http://i.imgur.com/5U70z.png[/img]
Best game 2013.
Making a little 'roguelike' engine! Trying to keep my code modular, map is a txt file, input is based on msvcrt but I'm planning on adding select input for linux and having it detect which is being used on startup. My whole entity and display system will work great when I switch to a tile engine, with a few modifications for the display obviously.
[media]http://www.youtube.com/watch?v=L0WuwrnTmK8[/media]
FPS is limited to 10 btw, I'm not [I]that[/I] awful at coding.
Feels good to post something here!
Why is it flashing?
[QUOTE=WTF Nuke;39212584]Why is it flashing?[/QUOTE]
I clear the console then redraw it, guess I could just keep printing without clearing, but add enough lines so it doesn't show the last drawn thing.
[QUOTE=Shadaez;39212668]I clear the console then redraw it, guess I could just keep printing without clearing, but add enough lines so it doesn't show the last drawn thing.[/QUOTE]
If your console supports it, a common trick is to use the '\r' escape character, which brings the drawing cursor back to the start of the line. This usually has a smoother effect from my experience. The only caveat is that whatever you're printing has to be the same or greater length than what is being covered up.
[editline]D_J_A_N_G_O[/editline]
I just realised that this is useless unless you can make your way back up to previous lines. According to SO, ANSI escape characters are the way to go:
[url]http://stackoverflow.com/a/11474509[/url]
I simply fill the rest with whitespace characters, there's no flashing when i do that.
You should enable double-buffering.
Create another buffer with [URL=http://msdn.microsoft.com/en-us/library/windows/desktop/ms682122(v=vs.85).aspx]CreateConsoleScreenBuffer[/URL]
To change buffers, you use [URL=http://msdn.microsoft.com/en-us/library/windows/desktop/ms686010(v=vs.85).aspx[/URL]SetConsoleActiveScreenBuffer[/URL] to bind another buffer.
You should use the WinAPI-supplied functions* for drawing to the console as well, so you can draw to the inactive screen buffer before binding it.
A common render loop would look like this:
[table="width: 500, align: left"]
[tr]
[td]• Clear inactive buffer[/td]
[/tr]
[tr]
[td]• Write to inactive buffer[/td]
[/tr]
[tr]
[td]• Bind inactive buffer[/td]
[/tr]
[tr]
[td]• Repeat with the other buffer[/td]
[/tr]
[/table]
*[URL=http://msdn.microsoft.com/en-us/library/windows/desktop/ms687404(v=vs.85).aspx]WriteConsoleOutput[/URL], [URL=http://msdn.microsoft.com/en-us/library/windows/desktop/ms687407(v=vs.85).aspx]WriteConsoleOutputAttribute[/URL], [URL=http://msdn.microsoft.com/en-us/library/windows/desktop/ms687410(v=vs.85).aspx]WriteConsoleOutputCharacter[/URL]
The WinAPI contains a ton of console functionality, and it's possible to make really crazy shit with it, check it out: [URL=http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073(v=vs.85).aspx]Console Functions[/URL]
I usually only update the characters that needs to be updated. Re-drawing everything is overkill for an ASCII based game.
When you move your character to the next tile, check the tile type of the tile you moved from and re-draw that tile.
[url]https://dl.dropbox.com/u/4189614/Snake.rar[/url] Here's an assignment we did two years ago using the same principle.
[QUOTE=Mozartkugeln;39211316]Started working on a tool in Java that automatically generates smooth brush roads as VMFs.
[IMG]https://dl.dropbox.com/u/17850283/spiralroad1.png[/IMG]
(This is after a lot of manual tweaking, but it's still pretty close.)[/QUOTE]
I've considered making something like this, but for surf maps. I've avoided it though since the VMF format is rather nightmarish. Great work though.
[QUOTE=Mr Kirill;39208406]Today I uploaded [url="http://www.newgrounds.com/portal/view/609301"]A Bit of Fun to Newgrounds[/url]!
After even more complaints about slippery controls, I made them super-responsive. Plays better now, in my opinion.[/QUOTE]
I would buy this
Trying to merge changes for a project that's been 4 months in the working to master today.
[img]http://i2.kym-cdn.com/photos/images/original/000/439/825/7f8.gif[/img]
currently trying to sort my life out
have a video
[media]http://www.youtube.com/watch?v=fPAvW2t5aTI&feature=youtu.be[/media]
[QUOTE=Tamschi;39209785]You [del]broke the ice[/del] created super glue.[/QUOTE]
Holy shit thanks for pointing this out. [url="http://www.newgrounds.com/portal/view/609301"]Fixed now[/url] and also improved hitboxes due to multiple complaints.
Also here's what I found in my game's code, written by me around 10 months ago:
[img]http://i.imgur.com/3GTnh.png[/img]
Fix it up, finish it, put on greenlight and have the next super meat boy.
[QUOTE=Mr Kirill;39215656]Holy shit thanks for pointing this out. [url="http://www.newgrounds.com/portal/view/609301"]Fixed now[/url] and also improved hitboxes due to multiple complaints.
Also here's what I found in my game's code, written by me around 10 months ago:
[img]http://i.imgur.com/3GTnh.png[/img][/QUOTE]
Space for jump?
[QUOTE=Se1f_Distruct;39215718]Space for jump?[/QUOTE]
why
[QUOTE=Mr Kirill;39215656]Holy shit thanks for pointing this out. [url="http://www.newgrounds.com/portal/view/609301"]Fixed now[/url] and also improved hitboxes due to multiple complaints.
Also here's what I found in my game's code, written by me around 10 months ago:
[img]http://i.imgur.com/3GTnh.png[/img][/QUOTE]
Why can't I go to previous level to collect a coin?
Sorry, you need to Log In to post a reply to this thread.