User:Le Forgeron/trace

From POV-Wiki
Jump to navigation Jump to search

UV data from user trace

  • Returns the intersection point trace( OBJECT, POINT [, NORMAL_RETURN [, UV_RETURN ]] ) as a vector
    • UV_RETURN is a vector whose content get the UV value at the intersection point
  • Returns UV value at the intersection point trace_uv( OJECT, POINT, DIRECTION ) as a vector
#version 3.8;
global_settings{ assumed_gamma 1.0 }

#declare Object = sphere { 0, 2 }

#declare Start = <0,4,0>;
#declare Dir = -Start;

#declare UV= trace_uv( Object, Start, Dir );
#declare Point=<0,0,0>;
#declare Normal=<0,0,0>;
#declare UV2=<0,0,0>;
#declare Start = <0,0,4>;
#declare Dir = -Start;
#declare Point = trace( Object, Start, Dir, Normal, UV2 ); 
#debug concat("UV : <", vstr(2, UV, ", ", 0, 3 ), ">\n")

#debug concat("\nPoint : <", vstr(3, Point, ", ", 0, 3 ), ">\n")
#debug concat("Normal : <", vstr(3, Normal, ", ", 0, 3 ), ">\n")
#debug concat("UV2 : <", vstr(2, UV2, ", ", 0, 3 ), ">\n")

#declare Start = <4,0,0>;
#declare Dir = -Start;
#declare Point = trace( Object, Start, Dir, Normal ); 
#debug concat("\nPoint : <", vstr(3, Point, ", ", 0, 3 ), ">\n")
#debug concat("Normal : <", vstr(3, Normal, ", ", 0, 3 ), ">\n")

#declare Start = <4,4,0>;
#declare Dir = -Start;
#declare Point = trace( Object, Start, Dir ); 
#debug concat("\nPoint : <", vstr(3, Point, ", ", 0, 3 ), ">\n")