OZONE Asylum
Forums
DHTML/Javascript
New junkie says hello
This page's ID:
28141
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
You had to divide the tex variable? That's very odd, since tex ends up as an integer [0..63], used to select which slice of the texture to use (and yes, you're right... I just chop each texture up into 64 images, that way I don't have to worry about slicing them in code. Nasty hack, but at the time, I wasn't aware of how to do it any other way!) See, in the code, can_u and can_v are where the ray intersects the wall, or the horizontal axis and vertical axis respectively. So, they're how I figure out which texture slice to use. The portions of (63 - tex) are to flip the wall texture backwards if it's on the back face of a cube. This way, no matter which direction you look at the cube from, the texture map is facing the same direction. I use 63 since that's the maximum value of tex, and since it's an integer. If it's a floating point value in the range [0..64), you're going to want to use (64 - tex) instead. That's my only guess so far... if I get a chance to look at your code in-depth, I'll try playing around. :) [edit] this reminds me... you said you saved the script, if you want the version with the images, it's [url=http://www.rpi.edu/~laporj2/random/code/raycaster.html]here[/url]. --- [url=http://www.rpi.edu/~laporj2/]Website[/url] [small](Edited by [url=http://www.ozoneasylum.com/user/4675]Iron Wallaby[/url] on 07-01-2006 03:41)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »