POV-Ray : Newsgroups : povray.general : Retrieving Speed from Moving object : Re: Retrieving Speed from Moving object Server Time
4 Aug 2024 16:08:28 EDT (-0400)
  Re: Retrieving Speed from Moving object  
From: Tim Nikias v2 0
Date: 6 Apr 2003 21:01:25
Message: <3e90cde5@news.povray.org>
It is like this:
I'm writing a Water-Surface-Simulation, you might have
noticed the animations and some images I've posted
recently.
The only thing missing for that was the ability to have
ANY object interact with it, especially when this object
is animated and moves around in the water.
Since I can't predict which kind of object a User might
want to drop into the water, and since my system
somehow needs to derive the position/speed in order
to calculate the interaction I've come up with this:

One Macro shall describe the object.
A second describes the transformations.

As you've pointed out, I can't get rotations from
that. But I didn't want the User to describe some
Multi-Section Macro for his object, this might be
over the head of some (probably even for me :-)

So, if someone would want to have something like a
watermill, he'd have to cut the pieces interacting with
the water into several parts, which will thus gain their
own speed/position calculations. This'll surely raise the
parsing time, but it seems more intuitive to me, than
some complicated macro.

And how does my system recognize the macros?
Well, the object-macro has a name, like "Object_1"
The respetive transform-macro should thus be
"Object_1" + "_Transform" = Object_1_Transform.
Using File-I/O, I parse the strings into a single Macro,
which my System will then use for its calculations.



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

> Tim Nikias v2.0 wrote:
> > I've got following problem:
> > For an algorithm to behave realistic, I need to know
> > the speed an object has. Problem is, I only have the
> > boundary-box accessible, and this one may change
> > its size. The object is macro driven and may suddenly
> > become something different, or just grow at certain
> > places.
> >
> > Thinking about it, there is no error-proof method of
> > getting the speed from that, is there?
> >
> > Hm. Perhaps I'll need to seperate object and its
> > transformation, and just apply the transformation to
> > a position. This'll give me the possibility of generating
> > the speed...
>
> If the object rotates, changes size or grows at certain points then
> different parts of it will be moving at different speeds, which point do
> you want to measure the speed of?
>
> I assume from what you've written that there is some nominal 'centre' of
> the object which is being translated by different amounts in different
> frames, but that due to the structure of your code this translation
> calculation and its results are inaccessable to your speed calculation.
> Without seeing any code it is difficult to see what the problem is, but
> it sounds as though the calculation that produces the transformation is
> bundled up inside a whole lot of other code in a macro that generates
> the object and positions it. In that case your last paragraph would seem
> to be bang on target, your code is not modular enough, and needs to be
> broken up into smaller logical units. Write a separate macro that does
> nothing but spit out a vector describing the translation of the object
> at a given moment, then call it from both the object generation code and
> the speed calculation.
>


Post a reply to this message

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