POV-Ray : Newsgroups : povray.pov4.discussion.general : Next Generation SDL Brainstorming : Re: Next Generation SDL Brainstorming Server Time
28 Sep 2024 18:02:57 EDT (-0400)
  Re: Next Generation SDL Brainstorming  
From: Allen
Date: 6 Apr 2009 13:20:01
Message: <web.49da38aead5940478f162dfb0@news.povray.org>
Programmable animation.

Currently each frame needs to be completely parsed.  I read somewhere that
support for multiple cameras is available in 3.7, making each camera a frame
with no need to parse the scene again.  But, still this allows no changes, so
perhaps if some OO model could exist for POV-Ray objects, and an event could be
called for each frame, allowing modifications to objects without the need to
reparse the entire scene.  This could especially speed up rendering of
animations that have hi-resolution meshes.

Some way of identifying items would be needed, and the event function.  I don't
know much about the internals to know if #declare could work for this.

circle
{
  <0, 0, 0>, 1

  #declare the_color_map = color_map
  {
    [0 color rgb 0]
    [1 color rgb 1]
  }

  ... // texture, pigment, etc
  color_map { the_color_map }
}


preframe_script
{
// execute after INI preframe command, and after the scene is parsed

// An object model with methods over function calls
#declare c = the_color_map.getitem(0)
the_color_map._setitem(0, c + <0.1, 0.1, 0.1, 0.0, 0.0>)

// or better yet
#declare the_color_map.entries[0].value += <0.1, 0.1, 0.1, 0, 0>


// full control over all aspects of all objects
the_circle.pos
the_circle.radius
the_circle.transforms
the_circle.textures
the_circle.interior



// full control even over the document
#declare new_item = document.create_circle()
#declare new_item.pos = ..
#declare new_item.radius = ...

}

Any object that uses 'the_color_map' would get updated.  If an object wants to
use a map without recreating it, it could get a unique copy, maybe something
like:

cirlce
{
  <0, 2, 0>, 1

  ...
  #declare another_map = color_map { clone(the_color_map) }
  color_map { another_map }

  // During preframe/postframe scripts, changing the_color_map will
  // change all objects that use it, but another_map is a clone of
  // the map and this circles color will not get changed unless
  // another_map is changed
}

One problem is this requires you to first #declare the item to give it a name,
the to use it.  There could exist a way to #declare it with a given name and
use it at the same time.


Post a reply to this message

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