POV-Ray : Newsgroups : povray.advanced-users : mesh Server Time
29 Jul 2024 06:15:34 EDT (-0400)
  mesh (Message 1 to 10 of 10)  
From: Gena Obukhov
Subject: mesh
Date: 14 Jan 2003 03:13:33
Message: <3E23C546.2E4F6606@mail.com>
I have an array of triangles. How can I reuse it in mesh ?
The following code doesn't work as I would expected:

mesh {
    #local cnt = 0;
     #while(cnt < arraySize)
        MyArray[cnt]
        #local cnt = cnt + 1;
     #end
}

Gena.


Post a reply to this message

From: ABX
Subject: Re: mesh
Date: 14 Jan 2003 04:55:55
Message: <e3n72vov1ae694q4qm0rgll8t75vtcjfro@4ax.com>
On Tue, 14 Jan 2003 00:07:34 -0800, Gena Obukhov <obu### [at] mailcom> wrote:
> I have an array of triangles. How can I reuse it in mesh ?
> The following code doesn't work as I would expected:

I suppose entries in your array are triangles as objects while triangles used
in mesha are simple suntax structure. You can't put triangle identifier in
mesh triangle. Instead of this you should store triangle vertices in array and
then reuse them. I hope this helps.

ABX


Post a reply to this message

From: Gena
Subject: Re: mesh
Date: 14 Jan 2003 12:53:44
Message: <3E244EA7.8187711B@mail.com>
I have to apply transformations (scale/rotate/translate) on triangles.
Mesh syntax doesn't allow transformations for triangles. So I decided
to create separate array of triangles and then build mesh based on
that array. It doesn't work.

If I'll keep vectors (triangles' vertices) instead of triangles in that array
what's the best way to apply transformations on those vertices ?

Gena.



ABX wrote:

> On Tue, 14 Jan 2003 00:07:34 -0800, Gena Obukhov <obu### [at] mailcom> wrote:
> > I have an array of triangles. How can I reuse it in mesh ?
> > The following code doesn't work as I would expected:
>
> I suppose entries in your array are triangles as objects while triangles used
> in mesha are simple suntax structure. You can't put triangle identifier in
> mesh triangle. Instead of this you should store triangle vertices in array and
> then reuse them. I hope this helps.
>
> ABX


Post a reply to this message

From: ABX
Subject: Re: mesh
Date: 14 Jan 2003 13:01:10
Message: <dtj82vsbis6d3e8ujnib6nr793pe7dtk3n@4ax.com>
On Tue, 14 Jan 2003 09:53:43 -0800, Gena <obu### [at] mailcom> wrote:
> If I'll keep vectors (triangles' vertices) instead of triangles in that array
> what's the best way to apply transformations on those vertices ?

look for vtransform, see http://www.povray.org/search/?s=vtransform

btw, transformations can be also stored in array iirc

ABX


Post a reply to this message

From: Tim Nikias
Subject: Re: mesh
Date: 14 Jan 2003 13:04:24
Message: <3e245128@news.povray.org>
For translation, simply add/subtract vectors to the vertices.
For scale, simply multiply the vertices with a float, or, for uneven
scaling, with another vector.
For rotation, use vrotate(), look in the docs to find its use. Simply
put, instead of using
object{Object rotate My_Vector}
 you apply
vrotate(Vertex,My_Vector)
and get the same result (sort of, you've just applied it to one vertex,
not all of em).

May I ask where you get you're vertex-data from? I'm about to release
some mesh-modelling-macros of mine, which take a 2D-Array filled with
vertices, and build almost anything from that...

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> I have to apply transformations (scale/rotate/translate) on triangles.
> Mesh syntax doesn't allow transformations for triangles. So I decided
> to create separate array of triangles and then build mesh based on
> that array. It doesn't work.
>
> If I'll keep vectors (triangles' vertices) instead of triangles in that
array
> what's the best way to apply transformations on those vertices ?
>
> Gena.
>


Post a reply to this message

From: Christoph Hormann
Subject: Re: mesh
Date: 14 Jan 2003 13:04:31
Message: <3E24512E.BCF09FAC@gmx.de>
Gena wrote:
> 
> I have to apply transformations (scale/rotate/translate) on triangles.
> Mesh syntax doesn't allow transformations for triangles. So I decided
> to create separate array of triangles and then build mesh based on
> that array. It doesn't work.
> 
> If I'll keep vectors (triangles' vertices) instead of triangles in that array
> what's the best way to apply transformations on those vertices ?
> 

You can use the 'vtransform()' macro.  If you apply the same transform to
a lot of vertices it will be more efficient to declare the transform
function once and apply it to the vertices.  See the 'vtransform()'
declaration in 'transforms.inc' for how this can be done.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Gena
Subject: Re: mesh
Date: 14 Jan 2003 14:19:05
Message: <3E2462A8.67C061C4@mail.com>
> May I ask where you get you're vertex-data from? I'm about to release
> some mesh-modelling-macros of mine, which take a 2D-Array filled with
> vertices, and build almost anything from that...

I'm working on tree generator Java program based on TomTree macro and
I want to add ability to save leaves as a mesh for... growing forests :)
So that program will save macro for generating mesh of triangles.

Gena.


Post a reply to this message

From: Tim Nikias
Subject: Re: mesh
Date: 14 Jan 2003 14:41:35
Message: <3e2467ef@news.povray.org>
I'm not sure if someone else hasn't done something like that
already, at least on the POV level. If you want to try it yourself,
no problem, go ahead, but if you're not like me and not willing to
do everything POV-related yourself, you could ask in
povray.general if someone has done it, and is willing to hand you
his/her code.

Regards,
Tim

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

>
> I'm working on tree generator Java program based on TomTree macro and
> I want to add ability to save leaves as a mesh for... growing forests :)
> So that program will save macro for generating mesh of triangles.
>
> Gena.
>


Post a reply to this message

From: gonzo
Subject: Re: mesh
Date: 14 Jan 2003 17:15:04
Message: <web.3e248b9afa4a615a0c272b50@news.povray.org>
Tim Nikias wrote:
>I'm not sure if someone else hasn't done something like that
>already, at least on the POV level. If you want to try it yourself,
>no problem, go ahead, but if you're not like me and not willing to
>do everything POV-related yourself, you could ask in
>povray.general if someone has done it, and is willing to hand you
>his/her code.
>
>Regards,
>Tim
>
>--
>Tim Nikias
>Homepage: http://www.digitaltwilight.de/no_lights/index.html
>Email: Tim### [at] gmxde
>
>>
>> I'm working on tree generator Java program based on TomTree macro and
>> I want to add ability to save leaves as a mesh for... growing forests :)
>> So that program will save macro for generating mesh of triangles.
>>
>> Gena.
>>
>

This is I think what you're referring to. generates a mesh, and iirc he
mentions in there somewhere that its based on TomTree...

http://www.netaxs.com/~ptdawson/ptdtree3.htm

RG


Post a reply to this message

From: Tim Nikias
Subject: Re: mesh
Date: 14 Jan 2003 20:09:22
Message: <3e24b4c2$1@news.povray.org>
Nope, that's not it. It does use triangles for leafs (leaves?),
but it's a different tree-algorithm (one I don't like very much,
when looking at the first image I don't recognise a tree there.

After searching the newsgroup for a while I found what I was
looking for:
http://news.povray.org/povray.binaries.images/28635/?ttop=29831&toff=250

Christoph Gerber made that image, perhaps you'd want to ask him
about it.

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

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