POV-Ray : Newsgroups : povray.general : Status of Moray? : Re: New SDL for POVRay Server Time
29 Apr 2024 01:27:03 EDT (-0400)
  Re: New SDL for POVRay  
From: Patrick Elliott
Date: 1 Nov 2007 01:35:55
Message: <MPG.219321b6faf0e91f98a05f@news.povray.org>
In article <47287d49@news.povray.org>, war### [at] tagpovrayorg says...
> Patrick Elliott <sel### [at] rraznet> wrote:
> > Your code, more or less:
> 
> > Frame 1:
> > Define array1, array2, array3.
> 
>   That's not "my code". Its your idea of what "my code" is.
> 
>   Why are you so obsessed with the arrays? How many times do I have to
> repeat that the arrays are not needed?
> 
>   Your array solution consists of two steps:
> 
> 1) Initialize the arrays at the beginning.
> 2) Execute some code at each frame which modifies the arrays.
> 
>   The proper solution is:
> 
> 1) Execute some code at each frame which transforms the objects.
> 
>   Basically your step 1 has been removed and only step 2 remains.
> No arrays needed.
> 
>   Perhaps you are confused by "execute some code at each frame"? Do you
> perhaps think that means that the user has to write some code for each
> single frame in the animation? Maybe that's what you are not comfortable
> with?
> 
>   No, the code is written just once. The SDL interpreter executes it at
> each frame.
>   It's the same idea as with loops (as I have mentioned before): Even tho
ugh
> the body of the loop is executed many times, the programmer only has to
> write it once and that's it. The exact same idea with the transformations
:
> You write them once and the interpreter executes them at each frame.
> 
>   Your arrays wouldn't be of much help in this, but would add one layer
> of complexity. Instead of having *one* piece of code which is executed at
> each frame, you would need *two* pieces of code: One to initialize the
> arrays and a second one to modify those arrays at each frame if needed.
>   (Of course you can have two pieces of code like this if you want to,
> but the idea is to not to force it.)
> 
>   Moreover, since the code which initializes your array is basically the
> same code which applies the transformations, that makes the array itself
> obsolete. The transformations can be applied to the object directly,
> without the need to store them in an array.
> 
> > My code, more or less:
> 
> > Frame 1:
> > Define table1.
> > Frame 3:
> > Change something in table1.
> 
>   That's exactly where the two steps are which you couldn't see.
> You have to be somehow able to tell the interpreter "at frame 3 execute
> these commands".
> 
> > Feel free to rant some more about it. But this time, please give a clea
r 
> > explanation for how you manage to do this *without* basically doing wha
t 
> > I described, or by, worse, not allowing someone to apply a table to the
 
> > whole nest of objects at all, but making them do it one at a time (whic
h 
> > is imho damn silly, since it not only disassociates the data from the
 
> > object, it disassociates the data from other related data).
> 
>   The user applies the transformations to the objects in the exact same
> way as they would apply those transformations to your arrays, but instead
> of being applied to the useless arrays, they are applied to the objects
> directly.
> 
>   It somehow seems that you have this concept that the user would have
> to literally write n pieces of transformation code for an animation with
> n frames. No, the user writes the transformations just once, and they
> are executed at each frame.
> 

Sigh.. Ok, so your entire argument is that you don't comprehend how it 
might be useful to do such a thing. And last time, arrays are not the 
same things as tables. An array contains only data, a table has indexes, 
so you can look things up by the index (and no, I don't mean a 
*numerical* index). In a table, you can place everything for "leg" under 
an index of "leg", not as array(1,n).

Ok, for the sake of argument, yes, you could do it 100% without a table. 
The question then becomes not, "can you?", but, "are there circumstances 
where you don't want to have to do so?" For example, how about this 
code:

a = opendb("my_database")
' I have no damn idea how you plan to get around this one, short of hand 
coding *every* step, which isn't really conducive to loops.
for each object in (blah) {
  tr = a.read(object.name,frame)
  object.applytransforms(tr)
}

vs.:

a = opendb("my_database")
table = a.read(parent_object.name,frame)
object.autotransforms(table)

Yes, something still has to do the step through, to apply them all, but 
you only do *one* lookup in the database, to get the *entire* table, not 
one set of transforms *per* object, or worse (since you hate arrays for 
much), multiple reads, such as:

a = opendb("my_database")
' I have no damn idea how you plan to get around this one, short of hand 
coding *every* step, which isn't really conducive to loops.
index = 0
for each object in (blah) {
  tr = a.read(object.name,frame,index)
  if tr then {
    object.applytransform(tr)
    index++
  }
}

This presumes the database returns "false" if it runs out of things to 
read. This is what **your** way would require for transforms from a 
database, one separate read for *every single tranform* you want to 
apply. If you don't use an array, you have to do at least 3 (for 
animation) for every object x the number of objects. With arrays of 
transforms, you still have to do one read for every object. With a 
table, you, assuming the DB allows this, read **one** table, which means 
*one* read. Its pretty irrelevant if you use my implicit linking to the 
object, or you just do something like "object.ApplyTransTable(table)". 
Its still way fracking more reasonable to do that than what you suggest. 
And, if you allow such a syntax, then you still have to do something 
like "for each object in..." within the parser/post-parser/core to make 
it work.

And seriously.. Do you really #$@#@# think Pixar or anyone else hand 
codes a mess of scripts when defining the actions of their virtual 
characters, instead of, *at minimum*, storing them in a file, or more 
likely, using a database to store entire sets of data, for each 
character? I rather doubt they spend hours writing loops in script, so 
that you have to calculate the numbers, every damn time they generate a 
scene. It makes no sense to do it that way. And it makes no sense at all 
to not have some method to apply the *entire* set of actions for a frame 
to a set of connected objects (such as a character), instead of writing 
code to specifically apply them, one at a time, to each *individual* sub 
object.

Once again, you don't actually give an example of what you think would 
work better, but just complain about how I don't have a clue what I am 
talking about and you have some *better* solution. Its getting real old.

-- 
void main () {

    call functional_code()
  else
    call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models,
 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

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