POV-Ray : Newsgroups : povray.general : Retrieving Speed from Moving object : Re: Retrieving Speed from Moving object Server Time
5 Nov 2024 13:26:58 EST (-0500)
  Re: Retrieving Speed from Moving object  
From: Edward Coffey
Date: 6 Apr 2003 20:49:55
Message: <3E90CE71.9020206@alphalink.com.au>
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.