User:Le Forgeron/trace

From POV-Wiki
< User:Le Forgeron
Revision as of 17:49, 31 December 2018 by Le Forgeron (talk | contribs) (Created page with "{{User:Le_Forgeron/HgPovray38/available}} === UV data from user trace === * Returns the intersection point <code>trace( OBJECT, POINT [, NORMAL_RETURN [, UV_RETURN ]] )</co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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")