@T.Ocarina it's confusing for me
so by adding more rays you mean finding collision on the particular wall from different points of view?or that's wrong
or is it just adding more vectors to your regular only view
i'm confused since i'm trying to picture a 3dimensional grid and built an object on that
i didn't study programming
all i know is self discoveries
i don't know the terms and algorithms like the sorting algorithms,raytracing,rngs
i did pong but it was super slow in a ti83,and so many games and apps but they were self discoveries
a friend of mine did pong with levels,with speeds and tougher cpu
no.
"secondary ray" doesnt mean "other ray".
it means the rays which is raised by initial ray.
for example,reflection, refraction,diffraction,scattering,diffusing rays.
if you think about these rays, it is called raytracing.
i cannot understand "verticle height",
but initial ray means the ray casting from your view point,usually.
(noting that raytracing and raycasting isnot only for rendering and the meaning of "initial ray" changes depending on the situation.
raycasting is widely used to detect collision.
laser beam and enemy in shooting game,
que and ball in billiard,
enemy sniper sight and wall, and so on.
ray tracing is also used in many applications.
Camera lens Design, Car light design, cosmic radiation shower simulation, etc...
rendering(drawing 3D object in 2D screen) is no more than one of the application.
> all i know is self discoveries
"self discovery" is the best. exciting and impressive.
thit question is not so difficult.
I think you can understand it by yourself.
keep it up :D
hint: fov is abbreviation of "field of view"
i know the fov and horizon,but what is camerangle?
for me fov and cameangle is the same rayangle
'cause i think fov is my view from screen,which is my cameraangle and ray angle is where i'll shoot my ray/rays
the code you showed means...
it assume(approximate) curved screen(part of cylinder).
the view point is the center of the cylinder.
"rayangle" is the angle of the casting ray.
"cameraangle" is the angle to the center of the screen.
"fov" is the angle of the arc streched by the screen
"horizon" is the number of the pixels of the screen.
it's all.
no.
I think it means
cast one ray at rayangle=cameraangle-fov/2
then
cast next ray at rayangle=cameraangle-fov/2 + fov/horizon
then
cast next ray at rayangle=cameraangle-fov/2 + 2* fov/horizon
...
finally, cast last ray at rayangle=cameraangle+fov/2
as usual "FOR ... NEXT" loop.
raytracing is slower than raycasting because you shoot a ray to every pixel on screen 400x240 pixels is 96000 pixels but gives a better image because raycasting only shoots rays equal to the horizon(which is 400 because it is the length of the screen. raytracing produces shading and a better image. I dont think raycasting can produce shaded walls,floors and ceilings.