|
|
On 01/29/2018 09:08 AM, Bald Eagle wrote:
> I'm looking to model a crushed box corner.
>
> This is likely something trivial to do in a mesh-based package like Blender,
> etc, but it seems to me to be rather complicated to work out the mechanism by
> which to model the folding of the faces and especially the corner - where there
> is by necessity actual crushing.
>
Understand your looking for mesh functionality, but you can fairly
quickly get a dented box look with an isosurface by routing a box
function through pigment(1) so as to have access to the pigment pattern
modifiers.
Bill P.
(1) - The pigment wrapper slows things down quite a bit. I'm not aware
of a better way at the moment - at least one which is relatively quick
to code.
//--------------- dentedBox.pov
#version 3.8;
global_settings { assumed_gamma 1 }
#default { finish {ambient 0.000 diffuse 1.0} }
#declare Grey50 = srgb <0.5,0.5,0.5>;
background { color Grey50 }
#declare Camera00 = camera {
perspective
location <3,3,-3.001>
sky y
angle 35
right x*(image_width/image_height)
look_at <0,0,0>
}
#declare White = srgb <1,1,1>;
#declare Light00 = light_source {
<150,150,-250>, White*<0.3,0.1,0.0>
}
#declare Red = srgb <1,0,0>;
#declare CylinderX = cylinder { -1*x, 1*x, 0.01 pigment { Red } }
#declare Green = srgb <0,1,0>;
#declare CylinderY = cylinder { -1*y, 1*y, 0.01 pigment { Green } }
#declare Blue = srgb <0,0,1>;
#declare CylinderZ = cylinder { -1*z, 1*z, 0.01 pigment { Blue } }
#include "functions.inc"
#declare Fn00 = function (x,y,z) {
-min(0,f_rounded_box(x,y,z,0.05,0.9,0.9,0.9))
// NOTE. The corner rounding value (0.05) is the most
// negative value as f_rounded_box implemented. Smaller
// values likely to drive up run time & drive tweak of
// isosurface function call.
}
#declare Pigment00 = pigment {
function { Fn00(x,y,z) }
warp {black_hole <0.7,0.6,0.2>, 0.7 strength 1 falloff 2 inverse}
warp {black_hole <0.7,0.7,0>, 0.5 strength 1 falloff 2}
warp {black_hole <0.7,0.7,0>, 0.6 strength 1 falloff 2}
warp {black_hole <0.7,0.7,0>, 0.7 strength 1 falloff 2}
warp {turbulence 0.02}
}
#declare Fn01 = function { pigment { Pigment00 } }
#declare Iso99 = isosurface {
function { 0.025-Fn01(x,y,z).red }
contained_by { box { <-1,-1,-1>,<1,1,1> } }
threshold 0.0
accuracy 0.0005
max_gradient 3.0
texture {
pigment { color White*0.7 }
normal { wrinkles 0.9 scale 0.01 }
}
}
//--- scene ---
camera { Camera00 }
light_source { Light00 }
object { CylinderX }
object { CylinderY }
object { CylinderZ }
object { Iso99 }
//--- end
Post a reply to this message
|
|
|
|
On 01/29/2018 09:49 PM, Bald Eagle wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
>
>> Understand your looking for mesh functionality, but you can fairly
>> quickly get a dented box look with an isosurface by routing a box
>> function through pigment(1) so as to have access to the pigment pattern
>> modifiers.
>
> That, Sir, is a fascinating approach, and the iterative black hole warps are an
> interesting way to "crinkle" the edge.
>
> I had to increase the strength to 4 to see what was really going on there.
>
> I will think on this some more - even if not perfectly suitable to the "My
> parcel got squished" look at hand, this certainly is an inspiring method - all
> sorts of possibilities.
>
> Thank you for that unexpected intellectual bright spot in an otherwise
> stultifying day :)
>
>
Happy to help with the anti-stultifying - if nothing else. :-)
I admit to not spending much time positioning the black_holes in the
example scene. Also remember in the shipped version of POV-Ray, we are
somewhat limited in what can be done with black_hole warps. The pulling
black_hole in fact clamps at strengths above 1 and can pull coordinates
from outside the range of the sphere depending on usage. The clamping
behavior can be very useful for effects, but it isn't very black hole
like in general. The clamping behavior is why I left the strength in my
example at 1.
A while back I posted some images for a proposed 'type 1' set of
black_holes which fixes the pulling black hole while leaving the inverse
behavior as is. I always planned to try additional types in addition to
the pulling fix - including one that ripples about an axis in the
sphere. Not too long ago, I closed my github pull req for the new 'type
1' to work on others - and promptly got distracted. :-) I am keeping the
'black_hole type 1' feature branch on github current with master should
anyone want to pull it into their private POV-Ray compiles as I do mine.
Bill P.
Post a reply to this message
|
|