Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Curved view  (Read 2006 times)

0 Members and 1 Guest are viewing this topic.
Curved view
« on: June 30, 2010, 08:32:45 pm »
  • Mr. Pixel
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 245
This one is hard to explain, so I drew example:

I haven't used surfaces before, so I have no clue how to do this.

~Drandula~

Edit. Using GM 8.0 Pro
« Last Edit: June 30, 2010, 09:04:28 pm by drandula »
Logged
Re: Curved view
« Reply #1 on: June 30, 2010, 08:40:22 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
A wild thought hear and probably completely wrong. Why don't you render the screen to an image first and after that put the image/surface on the inside of the cylinder as a texture.
Logged
Re: Curved view
« Reply #2 on: June 30, 2010, 08:48:53 pm »
  • Mr. Pixel
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 245
Well, I don't use 3D here. Surfaces obviosly won't work in 3D mode without Surface fix.
Logged

Mamoruanime

@Mamoruanime
Re: Curved view
« Reply #3 on: June 30, 2010, 09:02:07 pm »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I would assume the best way to do it is to find a way to manipulate the backbuffer :P

Or, if you can do a render to texture function, you'd be able to use 3d mode with an orthographic view, and just modify your texture.
Logged
Re: Curved view
« Reply #4 on: July 01, 2010, 12:25:43 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Hmm, why not render to a surface, then render the surface in strips, modifying the height of the strips according to a sine curve? It wouldn't give quite the same effect, since things wouldn't be stretched along the x-axis, but it may look good enough to pass itself off, or it may look hilariously horrible =P

I'm tired and probably not thinking straight, so if this is silly or not what you're asking forgive me XD
« Last Edit: July 01, 2010, 12:28:24 am by TheDarkJay »
Logged
Re: Curved view
« Reply #5 on: July 01, 2010, 02:22:20 am »
  • Fear my Blades
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 562
I'm sure you could use an inverse sine curve to figure out the x axis stretching as well.

My main computer died on me so I can't really test this out in Game Maker directly but the algorithm for scaling the surface would probably look something like:

Code: [Select]
for (i=0; i<view width; i+=1)
{
  t=i/view width;
  dx=arcsin(t*2-1)/pi+.5
  y_scale=1+(1-sin(t*pi)*effect multiplier)
  draw_surface_part_ext(surface, dx, 0, 1, view height, i, y_scale/2*view height, 1, y_scale, c_white, 1)
}

Replace the variables view width, view height, surface, and effect multiplier with corresponding values.  Effect multiplier is going to change how much the view gets stretched vertically, something like .5 or less would probably be appropriate.
Logged

I've done it (sorta)!  Bloom Lighting in GameMaker, and 3D mode too!  Check out the awesome Screen Saver.
  • Kousou Games
Re: Curved view
« Reply #6 on: July 02, 2010, 05:55:53 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
Are you merely looking to scale the surface though or are you more after a pinching effect?
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.019 seconds with 49 queries.