Old 28th January 2004, 11:36   #1
your-dentist
Junior Member
 
Join Date: Jan 2004
Location: berlin, germany
Posts: 44
Unhappy raytracing: inside and outside sphere

it took me only two days to understand the basics of raytracing and to make my first planes and tunnels DMs, just with the help of the easy to understand explantions by UnConeD. Due to my bad math skill I can make more complex objects. So I simply copied the "k" for a sphere from one of UnConeD's tuts.
What I don't understand is how to move the camera out of the shere.
when the cam coords are something like oz=1 it's inside and distorts the sphere. in discoball the z-coord is oz=sin(t)+1.9 or something.
who can explain me how to the camera outside of and object in general? (also for cylinders)
your-dentist is offline   Reply With Quote
Old 28th January 2004, 14:17   #2
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
The problem is that you need to pick the closest intersection point to the camera: for a sphere, there are usually two. If your camera only stays outside or inside, you can always use the same formula, otherwise you need to calculate both and compare them.

Copying k codes is pretty dumb though: the equation for a sphere around the origin is: x^2 + y^2 + z^2 = radius^2
If you've read my little raytracing intro, this should be enough to get you started and derive the k formula yourself.

UnConeD is offline   Reply With Quote
Old 30th January 2004, 07:48   #3
your-dentist
Junior Member
 
Join Date: Jan 2004
Location: berlin, germany
Posts: 44
thx.
got it now, my own in and out sphere.
it was just one sign in the "k" formula.
I still need lots of "training".
your-dentist is offline   Reply With Quote
Old 3rd February 2012, 17:03   #4
patipano
Junior Member
 
Join Date: Jan 2012
Posts: 18
Hey! What preset (or AVS Pack) of UnConed that explain about ray tracing and not very hard to understand?
patipano is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Visualizations > AVS > AVS Troubleshooting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump