POV-Ray : Newsgroups : moray.win : Mesh coordinates and animation Server Time: 9 Aug 2020 14:37:13 GMT
 Mesh coordinates and animation (Message 1 to 10 of 12)
 From: Kzerphii Toomk Subject: Mesh coordinates and animation Date: 5 May 2009 10:54:23 Message: <4a001adf\$1@news.povray.org>
```Is it possible to change coordinates of a mesh (or mesh 2) during an
animation...?

I'd like give life to meshes but XYZ resize is not enough... :))

Kzerphii
```
 From: Kenneth Subject: Re: Mesh coordinates and animation Date: 5 May 2009 16:55:01 Message:
```"Kzerphii Toomk" <kze### [at] orangefr> wrote:
> Is it possible to change coordinates of a mesh (or mesh 2) during an
> animation...?
>
> I'd like give life to meshes but XYZ resize is not enough... :))
>
>

If this is possible--and someone comes up with a way to do it in POV-Ray--then I
see all sorts of interesting possibilities.

A 'conceptual' example could be something like this:

object{
my_mesh_2_object
translate -clock*z
warp{turbulence...}
translate clock*z
}

....which would move the turbulence through the mesh.

Of course, the *reality* of moving all the triangle vertices around in this way,
in a coherent fashion, might be a tough coding problem.

KW
```
 From: clipka Subject: Re: Mesh coordinates and animation Date: 5 May 2009 21:30:00 Message:
```"Kzerphii Toomk" <kze### [at] orangefr> wrote:
> Is it possible to change coordinates of a mesh (or mesh 2) during an
> animation...?
>
> I'd like give life to meshes but XYZ resize is not enough... :))

Theoretically you can't change *anything* during an animation - you just write
the scene so that it produces different geometry for each frame, whether it is
a sphere, CSG, mesh or whatever; but I guess that's not the answer you were
after ;)

So a more practical reply to your question is "No, that's not possible - unless
you're auto-generating the mesh using SDL".
```
 From: Reactor Subject: Re: Mesh coordinates and animation Date: 6 May 2009 00:05:00 Message:
```"clipka" <nomail@nomail> wrote:
> "Kzerphii Toomk" <kze### [at] orangefr> wrote:
> > Is it possible to change coordinates of a mesh (or mesh 2) during an
> > animation...?
> >
> > I'd like give life to meshes but XYZ resize is not enough... :))
>
> Theoretically you can't change *anything* during an animation - you just write
> the scene so that it produces different geometry for each frame, whether it is
> a sphere, CSG, mesh or whatever; but I guess that's not the answer you were
> after ;)
>
> So a more practical reply to your question is "No, that's not possible - unless
> you're auto-generating the mesh using SDL".

The mesh needn't be auto-generated, I've been tinkering with a script that would
permit the use of control points that would allow an existing mesh to undergo
various transformations.  The idea was to allow the user to specify a control
point or groups of points, specify their effect radius, and specify a
transformation for each.  The points within the radius would be transformed,
taking into account the effect of distance from that control point and other
control points.

Simple testing indicates that it would be troublesome from a parsing standpoint,
since to do this it requires that every affected point in the mesh definition be
replaced with an expression that yields the modified vector.  I've been meaning
to finish writing C program that will insert the expressions, which will make
animating my wings models easier, but I haven't gotten around to it yet.

I do want to stress that it is very possible to animate a mesh2 in POV - so far
I've only used the divide and conquer method, but what I described above will
also work.

-Reactor
```
 From: clipka Subject: Re: Mesh coordinates and animation Date: 6 May 2009 10:40:01 Message:
```"Reactor" <rea### [at] hotmailcom> wrote:
> "clipka" <nomail@nomail> wrote:
> > So a more practical reply to your question is "No, that's not possible - unless
> > you're auto-generating the mesh using SDL".
>
> The mesh needn't be auto-generated, I've been tinkering with a script that would
> permit the use of control points that would allow an existing mesh to undergo
> various transformations.  The idea was to allow the user to specify a control
> point or groups of points, specify their effect radius, and specify a
> transformation for each.  The points within the radius would be transformed,
> taking into account the effect of distance from that control point and other
> control points.

Um... if I understand you correctly, you're then still auto-generating the mesh,
even though you wouldn't be using SDL but an external tool.
```
 From: Reactor Subject: Re: Mesh coordinates and animation Date: 7 May 2009 05:00:01 Message:
```"clipka" <nomail@nomail> wrote:
> "Reactor" <rea### [at] hotmailcom> wrote:
> > "clipka" <nomail@nomail> wrote:
> > > So a more practical reply to your question is "No, that's not possible - unless
> > > you're auto-generating the mesh using SDL".
> >
> > The mesh needn't be auto-generated, I've been tinkering with a script that would
> > permit the use of control points that would allow an existing mesh to undergo
> > various transformations.  The idea was to allow the user to specify a control
> > point or groups of points, specify their effect radius, and specify a
> > transformation for each.  The points within the radius would be transformed,
> > taking into account the effect of distance from that control point and other
> > control points.
>
> Um... if I understand you correctly, you're then still auto-generating the mesh,
> even though you wouldn't be using SDL but an external tool.

I'm not sure if I understand your meaning completely - when you say 'generating'
I tend to think of it as producing the coordinates for the mesh, whereas the
script is intended to read any pre-existing valid mesh2.  That said, the
transformation of the points are produced within SDL in response to the clock
variable or the user's desire.

That is to say, the external tool would modify the mesh2 declaration, for
example changing vector literals in the vertex_vector list into expressions
that produce a displaced vector with respect to clock (or whatever else the
users specifies).

-Reactor
```
 From: clipka Subject: Re: Mesh coordinates and animation Date: 7 May 2009 12:55:01 Message:
```"Reactor" <rea### [at] hotmailcom> wrote:
> I'm not sure if I understand your meaning completely - when you say 'generating'
> I tend to think of it as producing the coordinates for the mesh, whereas the
> script is intended to read any pre-existing valid mesh2.  That said, the
> transformation of the points are produced within SDL in response to the clock
> variable or the user's desire.
>
> That is to say, the external tool would modify the mesh2 declaration, for
> example changing vector literals in the vertex_vector list into expressions
> that produce a displaced vector with respect to clock (or whatever else the
> users specifies).

Yes, that's of course possible.

I'd consider this "auto-generating", which I'd define as "computing the actual
mesh vertices at script parse time [or earlier]".

Or, rather, even "meta-auto-generating", as you'd be auto-generating the code to
auto-generate the mesh vertices ;)
```
 From: Reactor Subject: Re: Mesh coordinates and animation Date: 7 May 2009 23:35:00 Message:
```"clipka" <nomail@nomail> wrote:

> Yes, that's of course possible.
>
> I'd consider this "auto-generating", which I'd define as "computing the actual
> mesh vertices at script parse time [or earlier]".
>
> Or, rather, even "meta-auto-generating", as you'd be auto-generating the code to
> auto-generate the mesh vertices ;)

Yep, that's how it'll work... eventually. <sigh>  The math part should be easy
to bake, but I've very little experience at writing robust parsing code, so
it'll be a learning experience.

-Reactor
```
 From: Stephen Subject: Re: Mesh coordinates and animation Date: 9 May 2009 23:45:49 Message:
```On Tue, 5 May 2009 12:54:16 +0200, "Kzerphii Toomk" <kze### [at] orangefr> wrote:

>Is it possible to change coordinates of a mesh (or mesh 2) during an
>animation...?
>
>I'd like give life to meshes but XYZ resize is not enough... :))
>

Hi Kzerphii,
I don't think that there is. You can animate the mesh in an animation if
you pre-animate a series of meshes and then include them one at a time during
the rendering. IIRC as I did not use the animation feature of Moray very much,
try using the include plugin and call the meshes with something like;

#include concat("E:\\Graphics\\Scenes
\\My_mesh_",str(mod(frame_number,89),-4,0),".inc")

PS the "My_mesh_",str(mod(frame_number,89),-4,0),".inc")" includes a mesh
numbered 0 to 89.inc in a cyclic fashion. Like My_mesh_0.inc

--

Regards
Stephen
```
 From: Kzerphii Toomk Subject: Re: Mesh coordinates and animation Date: 12 May 2009 21:24:36 Message: <4a09e914\$1@news.povray.org>
```Thanks for these answers... :)

"Reactor" <rea### [at] hotmailcom> a écrit dans le message de news:
web.4a036f5dc4c8e8b88ffa93e60@news.povray.org...
> "clipka" <nomail@nomail> wrote:
>
>> Yes, that's of course possible.
>>
>> I'd consider this "auto-generating", which I'd define as "computing the
>> actual
>> mesh vertices at script parse time [or earlier]".
>>
>> Or, rather, even "meta-auto-generating", as you'd be auto-generating the
>> code to
>> auto-generate the mesh vertices ;)
>
>
> Yep, that's how it'll work... eventually. <sigh>  The math part should be
> easy
> to bake, but I've very little experience at writing robust parsing code,
> so
> it'll be a learning experience.
>
>
> -Reactor
>
>
```