POV-Ray : Newsgroups : povray.general : Ray intersection test: Can't get my epsilon value right. I think. : Re: Ray intersection test: Can't get my epsilon value right. I think. Server Time
30 Jul 2024 12:21:58 EDT (-0400)
  Re: Ray intersection test: Can't get my epsilon value right. I think.  
From: triple r
Date: 7 Feb 2009 00:10:01
Message: <web.498d156d40536681ef2b9ba40@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> Hello, (and thank you for the macro! I hadn't even a clue where to start
> before.)
>
> Any suggestions as to how I might more adequately simplify my example file?

Start simple.  Learn the basics of vector/matrix math for 3D graphics.  Here's a
good
start:

http://chortle.ccsu.edu/VectorLessons/vectorIndex.html

This one is more relevant to POV-Ray:

http://www.geocities.com/evilsnack/matrix.htm

Then try out a couple scenes applying the basics.  Everything else is just
details.  Don't avoid vectors or calculus either.  I started early and it was
worth every second.  Here's an example scene of how to apply the same
transformation to a point and an object.  Then try the trace function by
pointing a vector at a sphere and drawing something at the resulting point.
Once you have the basics down, you can do anything you want.

 - Ricky


// VTRANSFORM SAMPLE
#include "transforms.inc"

camera{
    orthographic
    location <0,0,-2>
    look_at <0,0,0>
}

global_settings{ ambient_light 10.0 }

// Arrow going from <0,0,0> to <0,1,0>:
#declare arrow =
    union{
        cylinder{0, y*0.9, 0.025}
        cone{y*0.9, 0.05, y, 0}
        pigment{rgb x}
    }

// Vector pointing to the tip of the arrow
#declare tip_pt = <0,1,0>;

// Make a new transformation
#declare rotate_trans =
    transform{
        rotate <0,0,-35>
    }

// Apply the transformation to the OBJECT and draw the arrow
object{
    arrow
    transform{ rotate_trans }
}

// Apply the transformation to the POINT and draw a sphere there
sphere{
    vtransform( tip_pt, rotate_trans ), 0.02
    pigment{rgb y}
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.