I am interested in creating a raycaster project, so I've been looking at the scripts of some, but I can not understand the scripts. can anyone give me an explanation on how to make a raycaster?
Offline
It depends on the type of raycaster you're building. S65 for example, makes his completely virtual, which is harder to do, but provides more speed and accuracy.
Most people use a sprite that is shaped like an overhead view of the area the player is in. Then, they have a sprite that goes to where the player would be if he were standing in that overhead view.
Using lists, that sprite points in directions (usually the direction desired by the player + or - 0 to 30). It then moves at a rate of speed that is desired. As soon as the sprite touches the walls of the overhead view, it finds it's distance from where the player is standing, and adds it to a list (or replaces an item on that list).
When the entire list is full, that is, the sprite has scanned in all the wanted directions, a sprite is told to draw everything. This part is a little weird, because it x is determined by the direction is was pointing when if found that specific distance. It's two y positions are determined by finding the inverse of the distance (1/distance) and multiplying by a number that would draw the wall a specific height that makes sense for that distance. That number has to remain constant through out the whole drawing process though.
This is a rather broad coverage of raycasters, I'm hoping to make a project sometime that can explain them better.
Offline
thanks! let me know when you are done with the project
Offline
spuspu wrote:
thanks! let me know when you are done with the project
It probably won't be for a while since I'm in school and such...I don't plan to be posting anything until around Christmas, but I'll see if I can slip it in somewhere.
Offline
Offline
is trigonometry a must-know for raycasters?
Offline
spuspu wrote:
is trigonometry a must-know for raycasters?
Depends. If you're making a basic, visual map based raycaster, no. But, if you want to make a raycaster that is based on an array (virtual) you definitely need trig and other math. I could help you a bit, as right now, I'm working on a first-person shooter based off a raycaster engine ( http://scratch.mit.edu/projects/cygene/2004759 . )
Also, if you need a raycaster that's fast (for a game) I suggest making the map virtual. It's a whole lot faster, but harder to do.
Offline
cygene wrote:
spuspu wrote:
is trigonometry a must-know for raycasters?
Depends. If you're making a basic, visual map based raycaster, no. But, if you want to make a raycaster that is based on an array (virtual) you definitely need trig and other math. I could help you a bit, as right now, I'm working on a first-person shooter based off a raycaster engine ( http://scratch.mit.edu/projects/cygene/2004759 . )
Also, if you need a raycaster that's fast (for a game) I suggest making the map virtual. It's a whole lot faster, but harder to do.
Hey cygene, would you like apply for a Scratch Wiki account and help improve the Raycaster article?
Offline
scimonster wrote:
cygene wrote:
spuspu wrote:
is trigonometry a must-know for raycasters?
Depends. If you're making a basic, visual map based raycaster, no. But, if you want to make a raycaster that is based on an array (virtual) you definitely need trig and other math. I could help you a bit, as right now, I'm working on a first-person shooter based off a raycaster engine ( http://scratch.mit.edu/projects/cygene/2004759 . )
Also, if you need a raycaster that's fast (for a game) I suggest making the map virtual. It's a whole lot faster, but harder to do.Hey cygene, would you like apply for a Scratch Wiki account and help improve the Raycaster article?
Sure How do you apply, though?
Offline
cygene wrote:
scimonster wrote:
cygene wrote:
Depends. If you're making a basic, visual map based raycaster, no. But, if you want to make a raycaster that is based on an array (virtual) you definitely need trig and other math. I could help you a bit, as right now, I'm working on a first-person shooter based off a raycaster engine ( http://scratch.mit.edu/projects/cygene/2004759 . )
Also, if you need a raycaster that's fast (for a game) I suggest making the map virtual. It's a whole lot faster, but harder to do.Hey cygene, would you like apply for a Scratch Wiki account and help improve the Raycaster article?
Sure
How do you apply, though?
Read.
Offline
can u tell me what went wrong? http://scratch.mit.edu/projects/spuspu/2016488
Offline
spuspu wrote:
can u tell me what went wrong? http://scratch.mit.edu/projects/spuspu/2016488
What do you mean what went wrong? Seems fine to me.
Offline