![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I've posted in the past about learning to create a tree macro all by myself.
My trouble at this point is to figure out how to attach each block of truck
to each other when shifted out of alignment, a la not a perfectly straight
truck.
If you look at the attached image, you'll see I've got a cylinder broken
into four chunks, along with a solid cylinder next to it. I want this to
be my trunk. I'm looking to find out how to properly locate the beginning
and end points of each chunk. That way, I could properly rotate each chunk
to meet up with the one below it.
Can anyone give me some help? Thanks!
Post a reply to this message
Attachments:
Download 'new_tree.jpg' (12 KB)
Preview of image 'new_tree.jpg'
![new_tree.jpg](/povray.binaries.images/attachment/%3Cweb.44e35dcd1b38620b8a5251970%40news.povray.org%3E/new_tree.jpg?ttop=443866&toff=4300&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Lawrence W" <lwi### [at] csicable net> wrote:
> I've posted in the past about learning to create a tree macro all by myself.
> My trouble at this point is to figure out how to attach each block of truck
> to each other when shifted out of alignment, a la not a perfectly straight
> truck.
>
> If you look at the attached image, you'll see I've got a cylinder broken
> into four chunks, along with a solid cylinder next to it. I want this to
> be my trunk. I'm looking to find out how to properly locate the beginning
> and end points of each chunk. That way, I could properly rotate each chunk
> to meet up with the one below it.
>
> Can anyone give me some help? Thanks!
If you know the coordinates of each point of the trunk, you don'tneed to
rotate cylinders. Cylinders do not need to be created vertical. Just
specify the start and end coordinates and you are done.
-tgq
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Trevor G Quayle" <Tin### [at] hotmail com> wrote:
> "Lawrence W" <lwi### [at] csicable net> wrote:
> > I've posted in the past about learning to create a tree macro all by myself.
> > My trouble at this point is to figure out how to attach each block of truck
> > to each other when shifted out of alignment, a la not a perfectly straight
> > truck.
> >
> > If you look at the attached image, you'll see I've got a cylinder broken
> > into four chunks, along with a solid cylinder next to it. I want this to
> > be my trunk. I'm looking to find out how to properly locate the beginning
> > and end points of each chunk. That way, I could properly rotate each chunk
> > to meet up with the one below it.
> >
> > Can anyone give me some help? Thanks!
>
> If you know the coordinates of each point of the trunk, you don'tneed to
> rotate cylinders. Cylinders do not need to be created vertical. Just
> specify the start and end coordinates and you are done.
>
> -tgq
That's exactly my goal, but also the crux of my problem. How am I going to
track the start and end coordinates?
.... This may become a rather moot point as I find it MUCH quicker to use
POV-Tree. Nonetheless, I'm really curious about how to do it from scratch
for the learning potential.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Lawrence W" <lwi### [at] csicable net> wrote:
> "Trevor G Quayle" <Tin### [at] hotmail com> wrote:
> > If you know the coordinates of each point of the trunk, you don'tneed to
> > rotate cylinders. Cylinders do not need to be created vertical. Just
> > specify the start and end coordinates and you are done.
>
> That's exactly my goal, but also the crux of my problem. How am I going to
> track the start and end coordinates?
Maybe recursion is what you need? That's my first instinct for anything
that has multiple levels of sub-branches. (I know for a fact that
recursion works in POV-Ray.) Are you familiar with that technique?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Lawrence W wrote:
> "Trevor G Quayle" <Tin### [at] hotmail com> wrote:
>> "Lawrence W" <lwi### [at] csicable net> wrote:
>>> I've posted in the past about learning to create a tree macro all by myself.
>>> My trouble at this point is to figure out how to attach each block of truck
>>> to each other when shifted out of alignment, a la not a perfectly straight
>>> truck.
>>>
>>> If you look at the attached image, you'll see I've got a cylinder broken
>>> into four chunks, along with a solid cylinder next to it. I want this to
>>> be my trunk. I'm looking to find out how to properly locate the beginning
>>> and end points of each chunk. That way, I could properly rotate each chunk
>>> to meet up with the one below it.
>>>
>>> Can anyone give me some help? Thanks!
>> If you know the coordinates of each point of the trunk, you don'tneed to
>> rotate cylinders. Cylinders do not need to be created vertical. Just
>> specify the start and end coordinates and you are done.
>>
>> -tgq
>
> That's exactly my goal, but also the crux of my problem. How am I going to
> track the start and end coordinates?
>
> .... This may become a rather moot point as I find it MUCH quicker to use
> POV-Tree. Nonetheless, I'm really curious about how to do it from scratch
> for the learning potential.
>
>
The edges of the cylinder are going to jut out aren't they? Maybe a
different shape should be used? Sphere sweeps perhaps? Although they
would probably bring the render to a screeching halt. How about a mesh
object? Then you can have a macro to define the number of faces around
the trunk (ie an octagon tree or something with a lot more faces to make
it look smooth). You could could easily connect vertices as the tree
trunk curves, shrinking the radius as the tree goes to the top. I'm not
entirely sure how to mesh the branch intersections smoothly though (I
guess they could just overlap). The path of your tree trunk and
branches could be defined with a spline. Then you'll have a nice
curving shape to start with, and picking start and end points for your
cylinders merely involves evaluating the spline at the spline intervals
you need.
Skip
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Lawrence W wrote:
>> If you know the coordinates of each point of the trunk, you don'tneed to
>> rotate cylinders. Cylinders do not need to be created vertical. Just
>> specify the start and end coordinates and you are done.
>>
>> -tgq
>
> That's exactly my goal, but also the crux of my problem. How am I going to
> track the start and end coordinates?
I tackled this same problem a few years back. My solution was to use a
recursive call.
global_settings {
assumed_gamma 1
}
light_source {
<1000, 1000, 1000>
color rgb 1
spotlight
point_at 0
radius 1
falloff 5
}
camera {
location <120, 40, 0>
look_at <0, 30, 0>
}
plane {
y, 0
pigment {
rgb <0, 0.3, 0>
}
}
#macro bloblike (lrad, srad, length)
union {
sphere {
0, lrad
}
sphere {
<0, length, 0>, srad
}
cone {
0, lrad
<0, length, 0>, srad
}
}
#end
#macro bloblike_run (number, cnt, lrad, length, bend, twist)
#local srad = lrad * 0.9;
#if (number = 1)
object {
bloblike (lrad, srad, length)
}
#else
union {
bloblike_run (number - 1, cnt, srad, length, bend, twist)
object {
bloblike (lrad, srad, length)
}
rotate <bend, twist, 0>
#if (number != cnt)
translate <0, length, 0>
#end
}
#end
#end
object {
bloblike_run (10, 10, 4, 8, 7, 6)
pigment {
rgb <0.4, 0.2, 0>
}
}
Post a reply to this message
Attachments:
Download 'tree.jpg' (31 KB)
Preview of image 'tree.jpg'
![tree.jpg](/povray.binaries.images/attachment/%3C44e46202%40news.povray.org%3E/tree.jpg?ttop=443866&toff=4300&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Yeah, recursion is what you need. A few month ago, i also write a tree-macro
only for fun, which essential structure is like this:
#macro Tree(a,b,r,n)
#if (n=0)
cone { a,r, b,0.8*r }
#else
#local d=b-a;
#local c=a+0.5*d;
union{ cone {a,r, b,0.8*r }
Tree(c,c+0.4*vrotate(d,-45*z),0.9*r,n-1)
Tree(b,b+0.3*vrotate(d,45*z),0.8*r,n-1)
Tree(b,b+0.9*vrotate(d,3*z),0.8*r,n-1)}
#end
#end
At the end my macro is a bit complexer (see pic at the attachment)
Sorry for my bad englisch ;)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Skip Talbot nous apporta ses lumieres en ce 17/08/2006 00:15:
> Lawrence W wrote:
>> "Trevor G Quayle" <Tin### [at] hotmail com> wrote:
>>> "Lawrence W" <lwi### [at] csicable net> wrote:
>>>> I've posted in the past about learning to create a tree macro all by
>>>> myself.
>>>> My trouble at this point is to figure out how to attach each block
>>>> of truck
>>>> to each other when shifted out of alignment, a la not a perfectly
>>>> straight
>>>> truck.
>>>>
>>>> If you look at the attached image, you'll see I've got a cylinder
>>>> broken
>>>> into four chunks, along with a solid cylinder next to it. I want
>>>> this to
>>>> be my trunk. I'm looking to find out how to properly locate the
>>>> beginning
>>>> and end points of each chunk. That way, I could properly rotate
>>>> each chunk
>>>> to meet up with the one below it.
>>>>
>>>> Can anyone give me some help? Thanks!
>>> If you know the coordinates of each point of the trunk, you don'tneed to
>>> rotate cylinders. Cylinders do not need to be created vertical. Just
>>> specify the start and end coordinates and you are done.
>>>
>>> -tgq
>>
>> That's exactly my goal, but also the crux of my problem. How am I
>> going to
>> track the start and end coordinates?
>>
>> .... This may become a rather moot point as I find it MUCH quicker to use
>> POV-Tree. Nonetheless, I'm really curious about how to do it from
>> scratch
>> for the learning potential.
>>
>>
> The edges of the cylinder are going to jut out aren't they? Maybe a
> different shape should be used? Sphere sweeps perhaps? Although they
> would probably bring the render to a screeching halt. How about a mesh
> object? Then you can have a macro to define the number of faces around
> the trunk (ie an octagon tree or something with a lot more faces to make
> it look smooth). You could could easily connect vertices as the tree
> trunk curves, shrinking the radius as the tree goes to the top. I'm not
> entirely sure how to mesh the branch intersections smoothly though (I
> guess they could just overlap). The path of your tree trunk and
> branches could be defined with a spline. Then you'll have a nice
> curving shape to start with, and picking start and end points for your
> cylinders merely involves evaluating the spline at the spline intervals
> you need.
>
> Skip
You can use cones, maybe with spheres at the junctions.
If you use sphere_sweep, limit the lenght.
Using mesh is a prety good solution if you have several trees, like some 100's
or more.
Make 1 or 2 close trees with cones or many sphere_sweep. Then, you use 2 ot 3
different, scaled and randomly rotated mesh trees for the bulk of the forest.
--
Alain
-------------------------------------------------
WARNING: The consumption of alcohol may create the illusion that you are
tougher, smarter, faster and better looking than most people.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |