POV-Ray : Newsgroups : povray.text.scene-files : iso-frame Server Time
1 Jul 2024 03:22:00 EDT (-0400)
  iso-frame (Message 1 to 3 of 3)  
From:
Subject: iso-frame
Date: 2 Jan 2002 11:54:46
Message: <0ee63usb9s0s0s2q3s8qugpkes36r26dud@4ax.com>
Here is working of my iso-frame function/macro.
Macro is faster becouse create ready function() for dimension but if you want
parameters of f_frame as function of x,y,z then use function{}. I've tried
various version of below functions (unrolling torus as equation, temporary
functions) but below is fastes IMO. Frame bases on f_torus so it is on x-z
space.

#version 3.5;

#include "math.inc"
#include "functions.inc"
#include "finish.inc"

#local Max=3;

// enviroment

camera{
  orthographic
  location -2*Max*z
  direction z
  up 1.5*Max*y
  right 1.5*Max*x*image_width/image_height
}

background{ color rgb 1}

light_source{ (y/2-x-z)*300 color rgb 1 }

sphere{
  0,1
  pigment{granite color_map{[0 rgb .5][1 rgb 1]} scale .01}
  hollow
  scale 1000
  no_image
}

// MAIN PART

#macro f_frame_fast(DX,DZ,Major,Minor)
  #local DX2=(DX/2-Major);
  #local DZ2=(DZ/2-Major);

function{f_torus(select(abs(x)-DX2,0,abs(x)-DX2),y,select(abs(z)-DZ2,0,abs(z)-DZ2),Major,Minor)}
#end

#declare f_frame_slow=function(x,y,z,DX,DZ,Major,Minor)

{f_torus(select(abs(x)-DX/2,0,abs(x)-(DX/2-Major)),y,select(abs(z)-DZ/2,0,abs(z)-(DZ/2-Major)),Major,Minor)};
  
// dimensions of frame

#local DX=Max;
#local DZ=Max*469/700; // dimensions of image
#local Major=Max/10;
#local Minor=Max/20;

union{
  // frame
  isosurface{
    #local F=f_frame_fast(DX,DZ,Major,Minor);
    function{F(x,y,z)-f_agate(x*2,y*2,z*2)/100}
    contained_by{box{-Max,Max}}
    accuracy .001
    pigment{color rgb 1}
    finish{reflection .5}
    rotate x*90
  }
  // photo
  polygon{
    5
    0,x,x+y,y,0
    pigment{image_map{jpeg "3.jpg"}}
    finish{Glossy}
    translate -.5*(x+y)
    scale <DX,DZ,1>
  }
  scale 1.75
}


Post a reply to this message

From: Dennis Milller
Subject: Re: iso-frame
Date: 2 Jan 2002 21:48:37
Message: <3c33c685$1@news.povray.org>
I don't have your file "3.jpg," but when I try to use any of my own, I crash
POV 3.5 at the kernel. Any clues?
thanks much,
D.


news:0ee63usb9s0s0s2q3s8qugpkes36r26dud@4ax.com...
> Here is working of my iso-frame function/macro.
> Macro is faster becouse create ready function() for dimension but if you
want
> parameters of f_frame as function of x,y,z then use function{}. I've tried
> various version of below functions (unrolling torus as equation, temporary
> functions) but below is fastes IMO. Frame bases on f_torus so it is on x-z
> space.
>
> #version 3.5;
>
> #include "math.inc"
> #include "functions.inc"
> #include "finish.inc"
>
> #local Max=3;
>
> // enviroment
>
> camera{
>   orthographic
>   location -2*Max*z
>   direction z
>   up 1.5*Max*y
>   right 1.5*Max*x*image_width/image_height
> }
>
> background{ color rgb 1}
>
> light_source{ (y/2-x-z)*300 color rgb 1 }
>
> sphere{
>   0,1
>   pigment{granite color_map{[0 rgb .5][1 rgb 1]} scale .01}
>   hollow
>   scale 1000
>   no_image
> }
>
> // MAIN PART
>
> #macro f_frame_fast(DX,DZ,Major,Minor)
>   #local DX2=(DX/2-Major);
>   #local DZ2=(DZ/2-Major);
>
>
function{f_torus(select(abs(x)-DX2,0,abs(x)-DX2),y,select(abs(z)-DZ2,0,abs(z
)-DZ2),Major,Minor)}
> #end
>
> #declare f_frame_slow=function(x,y,z,DX,DZ,Major,Minor)
>
>
{f_torus(select(abs(x)-DX/2,0,abs(x)-(DX/2-Major)),y,select(abs(z)-DZ/2,0,ab
s(z)-(DZ/2-Major)),Major,Minor)};
>
> // dimensions of frame
>
> #local DX=Max;
> #local DZ=Max*469/700; // dimensions of image
> #local Major=Max/10;
> #local Minor=Max/20;
>
> union{
>   // frame
>   isosurface{
>     #local F=f_frame_fast(DX,DZ,Major,Minor);
>     function{F(x,y,z)-f_agate(x*2,y*2,z*2)/100}
>     contained_by{box{-Max,Max}}
>     accuracy .001
>     pigment{color rgb 1}
>     finish{reflection .5}
>     rotate x*90
>   }
>   // photo
>   polygon{
>     5
>     0,x,x+y,y,0
>     pigment{image_map{jpeg "3.jpg"}}
>     finish{Glossy}
>     translate -.5*(x+y)
>     scale <DX,DZ,1>
>   }
>   scale 1.75
> }


Post a reply to this message

From:
Subject: Re: iso-frame
Date: 3 Jan 2002 03:11:25
Message: <ja483uk64tpkhgrnfujob4fr88l3i9dcvv@4ax.com>
On Wed, 2 Jan 2002 21:47:00 -0500, "Dennis Milller" <dhm### [at] mediaonenet>
wrote:

>I don't have your file "3.jpg," but when I try to use any of my own, I crash
>POV 3.5 at the kernel. Any clues?

are you using beta 9 ? If "not" upgrade to beta 9 and check again.
if "yes" try with other image formats. If it still crash then cut this scene to
as small as possible (but stil crashing) and report it as a bug in
povray.beta-test (or povray.beta-test.binaries with sample image you used)

ABX


Post a reply to this message

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