POV-Ray : Newsgroups : povray.general : grouping transforms into one final rotation? : grouping transforms into one final rotation? Server Time
25 Apr 2024 17:00:31 EDT (-0400)
  grouping transforms into one final rotation?  
From: Kenneth
Date: 16 Sep 2018 18:15:00
Message: <web.5b9ed475f76fb4baa47873e10@news.povray.org>
[Sorry for the strange title; I couldn't think of anything better.]

Assume that I've traced an object using the trace(...) command, including the
normal found at the object's surface (Norm).

GIVEN:
#declare ROTATION_1 = <50,100,150>;  // just a different pre-declared rotation
to be used later

But now, I want to 'combine' the following with that rotation, somehow...

#declare MY_TRANSFORM =
transform{
#if(Norm.z < 0)
rotate 180*y
#else
#end
}

....plus a few other similar Norm-based #if transforms.

I want to end up with...
#declare NEW_ROTATION =  <...the new combined stuff...>;

Assume that it has to be done in this order. and that I need the new final
rotation as a single separate entity (for use in a #debug statement, for
example). What would be the easiest magic way (or built-in tool) to combine the
original rotation with the transforms? I'm stumped...except for the brute-force
method of...
#declare NEW_ROTATION =
<50, 100  #if(Norm.z < 0) + 180 #else #end, 150>;

.... which could get really cumbersome.


Post a reply to this message

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