Pseudo 3D Starfield
Posted: Tue Mar 11, 2008 5:36 pm
I'm looking for good 6502 examples of pseudo 3D starfields. I guess i'll also look at C64 or BBC games with 3D starfields in them too, if only to capture the code they used.
The accumulative methods i am experimenting with atm are not accurate or variable enough.
For example i am currently using a fractional stepping method in order to move the trajectory in all angles, but 8 bit fractional stepping is not sufficient..
Depending on FRAC this provides a sequence of regular 1's amongst 0's like 0000100001 in the Carry flag
Add this to XOffset which ranges 0-119 and then branch to add or subtract from 120 will provide the x position of the star.
Then by increasing the frac value i am able to increase the regularity of carry's and so increase the velocity of the star.
however wherther it be the random routine i am using to store the original FRAC for both x and Y trajectories or the limits of 8 bit fractional stepping i only ever get a limited number of trajectories and the result looks false.
What is most annoying is that i was sure i have done a good 3D starfield many years ago but have since lost the source.
The accumulative methods i am experimenting with atm are not accurate or variable enough.
For example i am currently using a fractional stepping method in order to move the trajectory in all angles, but 8 bit fractional stepping is not sufficient..
Code: Select all
lda reference
clc
adc frac
sta reference
Code: Select all
lda XOffset
adc #00
sta XOffset
Then by increasing the frac value i am able to increase the regularity of carry's and so increase the velocity of the star.
however wherther it be the random routine i am using to store the original FRAC for both x and Y trajectories or the limits of 8 bit fractional stepping i only ever get a limited number of trajectories and the result looks false.
What is most annoying is that i was sure i have done a good 3D starfield many years ago but have since lost the source.