POV-Ray : Newsgroups : povray.general : Align_Trans after rotation? Server Time
26 Dec 2024 08:19:47 EST (-0500)
  Align_Trans after rotation? (Message 1 to 2 of 2)  
From: Marc Weber
Subject: Align_Trans after rotation?
Date: 24 May 2013 00:55:02
Message: <web.519ef22df2ebb154ca4697da0@news.povray.org>
That's the idea:
https://github.com/MarcWeber/creating_animated_gimp_brushes

summary:
use povray to create animated brushes by creating a brush tip, then rendering a
depth map. I use pigment { function } and amibient { rgb 1} as suggested
somewhere else. That's fine.

Now when tilting the tip, I'd like to align the bottom of the tip at the y=0
pane.

Align_Trans works fine:

#declare my_prism =
prism {
  cubic_spline
  0, // sweep the following shape from here ...
  1, // ... up through here
  6, // the number of points making up the shape ...
  < 3, -5>, // point#1 (control point... not on curve)
  < 3,  5>, // point#2  ... THIS POINT ...
  <-5,  0>, // point#3
  < 3, -5>, // point#4
  < 3,  5>, // point#5 ... MUST MATCH THIS POINT
  <-5,  0>  // point#6 (control point... not on curve)

 scale 0.15
 rotate <0, 0, 90>
 translate <+0.1, 0, 0>

 rotate <rotate_x / 2, 0, rotate_z /2>
 rotate <rotate_x / 2, 0, rotate_z /2>
};

object {
  my_prism
  Align_Trans(my_prism,-y, <0,0,0>)
  TEXTURE
}


however using rotate_x or rotate_z other than 0 makes it fail.
So it looks like the bounding box gets rotated, too.

Is there another way I can try?

I could incrementally move the tip down till I get a "white" pixel (meaning I've
hit the plane) - but that's cumbersome.

I've seen that there is another thread at "advanced users" - there is even a
patch to create depth maps. Maybe I can use that and create a simple text file
containing depth as 2-dimensional float array which I could use to create the
brush tip easily.

Marc Weber


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Align_Trans after rotation?
Date: 24 May 2013 16:57:19
Message: <519fd42f@news.povray.org>
Marc Weber wrote:

> Is there another way I can try?

I'm not sure I follow 100% what you are trying to do but I think you
wish to find the "lowest point" on an object. You could approximate that
by sampling the object at a finite number of points using the trace
function. It is not more elegant than the shifting the tip down
but probably the easiest to do without manual intervention.


Post a reply to this message

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