rolling screen

BlitzMax Forums/BlitzMax Programming/rolling screen

Nigel Brown(Posted 2009) [#1]
I have an urgent need for a routine to roll the screen in the y axis, I need to convince the viewer they are looking at a tilted screen. Here is what I am trying to acheive, any ideas?

|----------|
|----------|
|----------|
|----------|
|----------|
frame 0

|----------|
|----------|
|----------|
frame 1

|----------|
frame 2


slenkar(Posted 2009) [#2]
i can only think of...

use render to texture on a cube, (sleptos version of minib3d?)

use opengl to do a transform, (have a look at minib3d to see how to switch states)


Stu_ovine(Posted 2009) [#3]
Draw the image twice. Heres pseudo code (assumes handle top left of image)


Drawimage Image1, 0, topY
Drawimage Image1, 0, topy - imageheight(image1)

topy:+4 ' scroll down
if topy > (height of the screen) then
topy = 0 ' reset to the top of the screen
endif


get the idea ?


Ked(Posted 2009) [#4]
Draw the image twice.

Or just use TileImage and reset the y coord when it is greater than the image height.


therevills(Posted 2009) [#5]
Re: TileImage:

"Its viewport dependent and you can't rely on that working on all hardware"


http://www.blitzbasic.com/Community/posts.php?topic=80113#900189


Nigel Brown(Posted 2009) [#6]
Guess rolling was not that good a description. I did'nt mean scrolling. I have edited the frames in the first post to give a better description, hopefully. Thanks for trying to answer though.

the minib3d thing sounds interesting will have a look at that.


QuickSilva(Posted 2009) [#7]
Hi Nigel, if you have access to B3D there is a sample in the 2D section that does what I think you are looking for. The example is called 5 screen FX (or similar) and the one you want is called drag and stretch.

Sorry, I do not have access to it at the moment but maybe someone would be kind enough to post it if you do not have it yourself. It is purely 2D code but looks 3D.

Hope this helps,
Jason.


Nigel Brown(Posted 2009) [#8]
QuickSilva, I have B+,B3D,BMAX but not able to find "Samples\Blitz 2D Samples\5screenfx\5fx.bb" Anyone help?


QuickSilva(Posted 2009) [#9]
I have the CD version, maybe it wasn`t included with the download version if you are using that?

Check your email :)

Jason.


slenkar(Posted 2009) [#10]
minib3d doesnt need kleptos version to do render to texture,
I just looked at the samples


Nigel Brown(Posted 2009) [#11]
QuickSilva, thanks that works exactly as I had wished for and its fast. Even when converted to run under BMAX :-)


Nigel Brown(Posted 2009) [#12]
Now I need to grab a screen image as an AnimImage or convert the image I grab in the following code:

Local image:TImage = CreateImage( screenWidth, screenHeight, 1 )
GrabImage(image, 0,0)

I need to then convert the image( screenWidth, screenHeight, 1 ) to AnimImage( screenWidth, 1, screenHeight ) is this possible?