Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / [Dark Physics] You can use only 1,0,-1 numbers for ray casting

Author
Message
wh1sp3r
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 26th Oct 2008 16:47


Try it, you will see.

something=PHY RAY CAST ALL SHAPEs(camera position x(), camera position y(), camera position z(), 0, -1.5, 0) // THIS DOESNT WORK

//something=PHY RAY CAST ALL SHAPEs(camera position x(), camera position y(), camera position z(), 0, -1.0, 0) THIS WORKS

Direction vector can consist from -1,0,1 numbers. Why ? lol

PS: Real programmers aren't afraid of math!.

AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 27th Oct 2008 19:09 Edited at: 27th Oct 2008 19:09
Because the former isn't a unit vector?

wh1sp3r
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 27th Oct 2008 20:45
So, if i want to perform raycast by custom vector, it doesnt work? hm, its useless, i think

PS: Real programmers aren't afraid of math!.

AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio, Internet 10/1 Mbit
Jeff032
16
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 28th Oct 2008 13:20
You do know that doing (0, -1, 0) is no different then (0, -1.5, 0), correct? (Because the second is just a scaled version of the first)

Just normalize your vectors before you use them and it really doesn't matter at all.

And any number between -1 and 1 is valid, not just -1,0,1

wh1sp3r
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 28th Oct 2008 18:23
what about 0.5 0.3 -0.8 hm ? I would like to have custom raycast vector so ?

PS: Real programmers aren't afraid of math!.

AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio, Internet 10/1 Mbit
Jeff032
16
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 28th Oct 2008 18:58
Yes, what about it?

Divide each component of the vector by the length of the vector and it should work fine, if it doesn't work already (also called normalizing)

length of vector = sqrt(x*x + y*y + z*z)

wh1sp3r
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 28th Oct 2008 20:33
What about SET NORMALIZATION ON ? hm

PS: Real programmers aren't afraid of math!.

AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio, Internet 10/1 Mbit
Jeff032
16
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 28th Oct 2008 21:44
That's for lights...

Login to post a reply

Server time is: 2024-05-22 11:54:43
Your offset time is: 2024-05-22 11:54:43