#How do I calculate delta distance in DDA algorithm with the full (non-simplified) calc, in 3D?
12 messages · Page 1 of 1 (latest)
Have you read this paper?
https://diglib.eg.org/items/60c72224-00f3-416d-9952-ee41e8c408da
A fast and simple voxel traversal algorithm through a 3D space partition is introduced. Going from one voxel to its neighbour requires only two floating point comparisons and one floating point addition. Also, multiple ray intersections with objects that are in more than one voxel are eliminated.
If box is tranformed, you can apply inverse transform to box and ray. In general you can do dda in any space you want, just apply suitable transformation to the ray
It doesn't let me read the paper and I've seen the other one
What I meant by box, is a voxel. I don't know why I said box...
Also do you mean apply inverse view matrix onto the ray position or something?
The thing is, I successfully rendered a 3D scene with DDA ray tracer, but right now my objective is to figure out how to make the voxels smaller.
The voxels are contained in a 3D array.
Here's the code of what I did:
https://pastebin.com/4RXuJL0C
It'll be easier this way
I explained some parts of the code in the comments