POV-Ray : Newsgroups : povray.binaries.images : Sci-Fi Scene Assets : Re: Sci-Fi Scene Assets Server Time
29 May 2024 04:55:15 EDT (-0400)
  Re: Sci-Fi Scene Assets  
From: Bald Eagle
Date: 1 Mar 2021 17:35:01
Message: <web.603d6bd6a906d8e31f9dae300@news.povray.org>
So, following the logic from:
http://news.povray.org/povray.general/thread/%3Cweb.410eba6fcd20604ecbae57f30@news.povray.org%3E/?ttop=300207&toff=1950


just include transforms.inc, THEN redefine the "offending" macro:

#macro VPerp_To_Vector (v0)
 #if (vlength(v0) = 0)
  #local vN = <0, 0, 0>;
 #else
  #local x_point = vcross (x, v0);
  #if (vlength (x_point) = 0)
   #local x_point = vcross(y, v0); // if x was parallel to v0, try y instead
  #end
  #if (vlength (x_point) = 0)
   #local x_point = vcross(z, v0); // if x was parallel to v0, try y instead
  #end
 #end
  #local vN = x_point;
   vN
#end

Then generate your random points, find your intersection point and normal
vector,
#declare Normal = <0, 0, 0>;
#local iPoint = TracePointA (Sphere, Loc, Normal);
object {Greeble Point_At_Trans (Normal) translate iPoint}

and you should be good.


Post a reply to this message


Attachments:
Download 'greeble_placement.png' (196 KB)

Preview of image 'greeble_placement.png'
greeble_placement.png


 

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