![]() |
|
|
|
Thread Tools | Display Modes |
|
(#1)
|
|
|
Moderator
Posts: 882
Join Date: 2002.05
Location: Anaheim Hills, California
|
Parallax Scrolling -- I've got it! -
2002.10.06, 07:27 PM
Well, I figured out parallax scrolling on my own. I figured it couldn't be too hard, so I thought about it for a second, and played with it for a while and I figured it out.
Here's the two lines of code (per layer) that it requires: LayerOffset = DeltaX * ((LayerWidth - ViewWidth)/(ForegroundLayerWidth-(ViewWidth*2)) DrawPicture LayerPicture, LayerOffset, 0 Where ViewWidth is the width of the animation area (i.e. if you wer e full screen, ViewWidth would be the screen width), and DeltaX is the number of pixels that you're scrolling. One thing I did notice is that in my current example project, the Foreground scrolling rate isn't equal to 1, it's actually equal to 1.3 which is kind of odd. I know that it makes sense mathematically using the code above, but I wonder what I would need to change to get it equal to 1 instead. If you have any ideas on that, could you let me know? One other question, where did the word Parallax come from? It obviously sounds like a combination of parallel axis, which kind of makes senses, but is that really where it came from? |
|
|
|
|
(#2)
|
|
|
Posts: n/a
|
2002.10.07, 11:17 AM
Well on the subject of flaunting your own intelligence. To test if you have cliked on an odd or even isometric tile of size 64*31
sin(((x-32)*pi)/64)>cos(((y-64)*pi)/32) It works on my computer I have rigerously tested it I worked that out myself too!!! |
|
|
|
|
(#3)
|
||
|
Member
Posts: 227
Join Date: 2002.09
Location: Atlanta, Georgia
|
Re: Parallax Scrolling -- I've got it! -
2002.10.07, 12:50 PM
Quote:
Cheers, Rocco |
|
|
|
|
|
(#4)
|
||
|
Moderator
Posts: 882
Join Date: 2002.05
Location: Anaheim Hills, California
|
Re: Re: Parallax Scrolling -- I've got it! -
2002.10.07, 08:40 PM
Quote:
|
|
|
|
|
|
(#5)
|
|
|
Moderator
Posts: 948
Join Date: 2002.09
Location: Stockholm, Sweden
|
The meaning of the word Parallax -
2002.10.11, 02:12 PM
I'm not really sure on the full meaning of the word, but here's my two cents; para- is a prefix for "beyond" or "more than" or even "after". -lax is a stem for a lot of words meaning "wider", "wide", "widening", "extending" and suchlike.
Thus, parallax would mean something around the lines of "beyond the wide", which is quite appropriate for something used to measure stars. ![]() All in Latin of course. ![]() |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|