|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
hi all,
here's a chunk of code for your consideration (m and cm are arbitrary units
of meters and centimeters)
//start
#local fn = function { pattern {granite} };
HF_Square (fn, no, no, <25,25>, yes, "square1.inc", <0,0,0>, <1,1,1>*m)
object{#include "square1.inc" scale <1,0.1,1> pigment{Green}}
HF_Cylinder(fn, no, no, <25,25>, yes, "cylinder1.inc", <0,0,0>, <0,0,1>*m,
5*cm,10*cm)
object{#include "cylinder1.inc" translate -5*cm*y pigment{Red}}
//end
How would I manipulate this such that the cylinder 'tiles' seamlessly with
the square. The basic end result I'm aiming for is a round_box with a real
normal as opposed to a normal normal... or is there an easier way?
thanks in advance
jim
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
James Taylor <jim### [at] blueyondercouk> wrote:
> The basic end result I'm aiming for is a round_box
I would say that the best and more versatile thing you could do is
to create a HF_RoundBox() macro which creates a mesh-heightfield with
the shape of a rounded box, with the same principle as the other HF_*
macros.
Of course it's a rather laborious job to do, specially if you are
not very strong at math, but by looking at how the other HF_* macros
are made, it shouldn't be too difficult.
I would say that the HF_Sphere() macro is closest to what you want to
do. Copying and modifying it might be the easiest way.
Of course you can ask the author of the macros to kindly help you... :)
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:3e1f70c0@news.povray.org Warp wrote:
> I would say that the best and more versatile thing you could do is
> to create a HF_RoundBox() macro which creates a mesh-heightfield with
> the shape of a rounded box, with the same principle as the other HF_*
> macros.
Just an idea, more general than the above: find the set parametric
equations for the "superquadratic ellipsoid" then plug in a forth function
for the displacement and build a mesh using 'param.inc' or the
'parametric' object.
Ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:Xns### [at] povrayorg ingo wrote:
> Just an idea, more general than the above: find the set parametric
> equations for the "superquadratic ellipsoid" then plug in a forth
> function for the displacement and build a mesh using 'param.inc' or
> the 'parametric' object.
>
Couldn't resist, although I have to do other things, so here is the
basic stuff for the superellipsoid as a parametric without displacement.
Equation and information comes from:
http://diogenes.iwt.uni-bremen.de/vt/laser/papers/Wriedt-
superellipsoids-PartPartSystCharact-2002.pdf
param.inc can be found at: http://members.home.nl/seedseven/
---%<------%<---
#version 3.5;
#include "param.inc"
#include "math.inc"
global_settings {assumed_gamma 1.0}
camera {location <0,0,-3> look_at <0,0,0>}
light_source { <500,500,-500> rgb <1,0.9,0.8> }
light_source { <-100,100,-500> rgb <0.3,0.3,0.5> }
#declare A=1; //controles the size
#declare B=1;
#declare C=1;
#declare N=0.4; //controles the shape
#declare E=3.3;
#declare F1=function(u,v){A*sgn(cos(u))*pow(abs(cos(u)),N)*sgn(cos(v))
*pow(abs(cos(v)),E)}
#declare F2=function(u,v){B*sgn(cos(u))*pow(abs(cos(u)),N)*sgn(sin(v))
*pow(abs(sin(v)),E)}
#declare F3=function(u,v){C*sgn(sin(u))*pow(abs(sin(u)),N)}
object {
Parametric (
F1, F2, F3,
<-pi/2,-pi>, <pi/2,pi>,
50, 50,""
)
pigment {uv_mapping checker rgb 1 rgb <0,0,1> scale <0.2,0.1,1>}
finish{specular 0.3}
rotate <45,0,0>
}
---%<------%<---
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I think I should have worded my post a little better, I don't actually want
a round box, just something that would allow for CSG with rounded edges
using heightfields for the normal (if all that makes sense).
I haven't had chance to play with the code (and prob. won't be able to until
nest week) but I'm guessing the function needs to be "shifted" along such
that edges match.
Which raises another question - how is the heightfield mapped onto a
cyinder and sphere in the HF_* macros? take the cylinder{0,y} where does the
mapping start?
thanks
jim
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3e1f70c0@news.povray.org...
> James Taylor <jim### [at] blueyondercouk> wrote:
> > The basic end result I'm aiming for is a round_box
>
> I would say that the best and more versatile thing you could do is
> to create a HF_RoundBox() macro which creates a mesh-heightfield with
> the shape of a rounded box, with the same principle as the other HF_*
> macros.
> Of course it's a rather laborious job to do, specially if you are
> not very strong at math, but by looking at how the other HF_* macros
> are made, it shouldn't be too difficult.
> I would say that the HF_Sphere() macro is closest to what you want to
> do. Copying and modifying it might be the easiest way.
>
> Of course you can ask the author of the macros to kindly help you... :)
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3e21c8b9@news.povray.org>,
"James Taylor" <jim### [at] blueyondercouk> wrote:
> Which raises another question - how is the heightfield mapped onto a
> cyinder and sphere in the HF_* macros? take the cylinder{0,y} where does the
> mapping start?
The macros take a function and pass it the actual vertices, and use
return value as the displacement amount. Things like spherical or
cylinderical mapping from this are pretty easy, there are functions
provided for it.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|