News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Raycasting Help?

Started by ScottieB, July 30, 2015, 05:56:49 AM

Previous topic - Next topic

ScottieB

I've started to work on a raycasting engine.
It works so far.

It uses X&Y Intercepts.

I'm having a problem moving the player around without screwing up the rays.
Can someone help me improve the movement.
Any help would be greatly appreciated.
Thanks
ScottieB


ScottieB

#1
Can some please help me find the proper distance to the first walls?  
The it's only multiplied from there.

It works great at center of world then once I move It's wrong.
Something more is needed for right distances.

Please I'm really racking my brain here.
Thanks
ScotttieB


Well,I'm so stumbed about this it's not funny.
I just can't seem to find a way to get the first distance to the first y & x intersect when moveing the player around.
Kevin,  can you shine some light on this?

everyother intersect is easy enough.  but that first one is hard to figure due to the location of the player moveing around.

I did look on the internet and tried a few things but I could get nothing to work.
If someone could please help a stumped programmer it would be greatly appreciated.

Thanks
Again and soory I'm not sparking too much interest about this one.

ScottieB

Well I made my way past intercepts and collision with walls.

Now, I need to remove fish-eye distortion.

It's partially working.

Can anyone help me tweak this to work better?
Please if you can help I would be greatful.

It's a slow process but I'm understanding the math so far.

ScottieB

Check it out it's now working!

Can anyone help me to figure out what's causing the weird random lines at points????

Thanks
ScottieB

I don't know what those freaky lines are at points they vanish and then reappear.
I thought it was an X&Y intercept but not quite don't know???


stevmjon

hey scottie
I looked at your raycaster.zip and almost worked it out, but you beat me to it. good job.
I ran the update.zip and I think the lines are the borders of each section, where the walls connect. the spacing looks right to be this. I will look more closely at the code and see if I can help.

is this going to be a 3D type of game?  it is running at 1 fps when I disable waitkey on my i7 computer.

I like how you got 3D walls from the data, with doorways in the correct position. this will make map making very easy.

   stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

ScottieB

Those nasty little lines seem to be the planes extending.

How do I shrink them???

What is causeing this glitch???

Can anyone help me debug this sucker!
Please
ScottieB

The Idea is there just needs to be tweaked.
Thanks a bunch.

ScottieB

Take a look at this.

It's the start and end of the intercepts 0 and 63 our texturemapping ughhhhhhhhh.

It fixes it graphically but now it's jerky and also cuts into our texturemapping routine. 0 and 63

What do I do now??????


stevmjon

hey scottie

I have been looking through your code, which is pretty complicated, and hopefully have helped to point you in the right direction with the lines bug (see pic).
I added a little heads up display to help me work out how this code works. that's how I found the lines bug, hopefully.

I will post the code later when I work out where exactly to make the changes, if I do it before you.
hope this helps.

  stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

ScottieB

I only get half of what your saying.
Are you working on a way to fix this?
because I'm still stumped?
Those nasty lines seem to be the only problem right as of so far.
I would really like to resolve this issue so I can continue.
Any more help would be great really!
Thanks for at least looking a it so far.

ScottieB

Both X & Y share the same intercepts at 0 and 63 and the colour keeps switching.
but this is also the texture coordinates 0 - 63 for all texturemapping.
now the question is which one is the proper one for the lighting as you see the walls.
1 is X
2 is Y

but what is a shared one?????
that I think is the problem.

ScottieB


Fhhhhhhhhhuuuuuuuuueeeeeeeeee.

Finally I got it!
Skip all corners.

Now I can move on.
Hard part over.
for the most part.

Enjoy and reply what can you make of it.


ScottieB

Textures anyone!

Kewl!  I finally wrap my head around the concept of raycasting!

It took me many tries to get it but now I got it.

There is a lot going on here inside this little program.
I failed at getting it to workout this way for along time but I presisted and prevailed!!!

And now it's here for all newbies!!!!

stevmjon

I see you have put a lot of work into this.

there are a lot of calculations going on. it would have taken you some time to work all this out.
you must like maths.

thanks for sharing.
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

kevin


well done.. glad you found a way !

ScottieB

Would anyone know how I can add floorcasting and ceilingcasting to this raycaaster?

There's a bit of info on the net but most say it slow.
If I do it I am going to need it to be fast.

Any Ideas?

Thanks
ScottieB