|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Guys,
I am new to the povray community, and after reading the manual I am still not
sure what's the best way to achieve my goal:
I have a simulation written in c++ in which I simulate rigid bodies moving. In
each time step each body's position and orientation change.
I want to render my simulation using POV-Ray. What is the correct way? I can
output a pov file for each frame and then render each pov file and make an
animation.
However, as the meshes are rather large and do not change between frames (only
their orientation and position change), I hope there's a simpler way to just
write the mesh once and then reference it when producing the animation.
What is the best way to achieve my goal?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 16.05.2012 22:53, schrieb noam:
> Hi Guys,
> I am new to the povray community, and after reading the manual I am still not
> sure what's the best way to achieve my goal:
>
> I have a simulation written in c++ in which I simulate rigid bodies moving. In
> each time step each body's position and orientation change.
> I want to render my simulation using POV-Ray. What is the correct way? I can
> output a pov file for each frame and then render each pov file and make an
> animation.
> However, as the meshes are rather large and do not change between frames (only
> their orientation and position change), I hope there's a simpler way to just
> write the mesh once and then reference it when producing the animation.
>
> What is the best way to achieve my goal?
You can generate one include file (see "#include") for the shapes,
another one specifying their locations for each frame, and tie
everything together in a manually created .pov file.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <ano### [at] anonymousorg> wrote:
> Am 16.05.2012 22:53, schrieb noam:
> > Hi Guys,
> > I am new to the povray community, and after reading the manual I am still not
> > sure what's the best way to achieve my goal:
> >
> > I have a simulation written in c++ in which I simulate rigid bodies moving. In
> > each time step each body's position and orientation change.
> > I want to render my simulation using POV-Ray. What is the correct way? I can
> > output a pov file for each frame and then render each pov file and make an
> > animation.
> > However, as the meshes are rather large and do not change between frames (only
> > their orientation and position change), I hope there's a simpler way to just
> > write the mesh once and then reference it when producing the animation.
> >
> > What is the best way to achieve my goal?
>
> You can generate one include file (see "#include") for the shapes,
> another one specifying their locations for each frame, and tie
> everything together in a manually created .pov file.
Thanks! That solves almost everything, but how would I create an array for the
orientation matrices (I assume I would to create an array of matrices and then
index through it using 'clock')?
Post a reply to this message
|
|
| |
| |
|
|
From: Christian Froeschlin
Subject: Re: best to animate simple moving meshes
Date: 17 May 2012 10:02:07
Message: <4fb504df$1@news.povray.org>
|
|
|
| |
| |
|
|
noam wrote:
> Thanks! That solves almost everything, but how would I create an array for the
> orientation matrices (I assume I would to create an array of matrices and then
> index through it using 'clock')?
If you just want to apply transformations to your object you can
create an array such as
#declare TRANSFORMS = array[42];
#declare TRANSFORMS[0] = transform {rotate 90*x translate 5*z};
#declare TRANSFORMS[1] = ...
...
and use it like this
object
{
...
transform {TRANSFORMS[i]}
}
Of course you can also use a twodimensional array (or multiple
arrays) to holds the individual rotation and translation parameters
or matrix elements.
Post a reply to this message
|
|
| |
| |
|
|
From: Christian Froeschlin
Subject: Re: best to animate simple moving meshes
Date: 17 May 2012 10:13:03
Message: <4fb5076f$1@news.povray.org>
|
|
|
| |
| |
|
|
Christian Froeschlin wrote:
> #declare TRANSFORMS = array[42];
actually, since you have multiple objects you probably want
this to be something like
#declare TRANSFORMS = array[NUM_OBJ][NUM_TRANSFORMATIONS];
// Object 0
#declare TRANSFORMS[0][0] = transform {rotate 90*x translate 5*z};
#declare TRANSFORMS[0][1] = ...
// Object 1
#declare TRANSFORMS[1][0] = transform {rotate 40*x translate 5*z};
#declare TRANSFORMS[1][1] = ...
And in your shapes include file
#declare SHAPES = array[NUM_OBJ];
#declare SHAPES[0] = mesh {...}
#declare SHAPES[1] = mesh {...}
...
and use it as
#declare FRAME = <transformation index from "clock" or "frame_number">
#declare I = 0;
#while (I < NUM_OBJ)
object
{
SHAPES[I]
transform {TRANSFORMS[I][FRAME]}
}
#declare I = I + 1;
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Christian Froeschlin wrote:
> > #declare TRANSFORMS = array[42];
> actually, since you have multiple objects you probably want
> this to be something like
> #declare TRANSFORMS = array[NUM_OBJ][NUM_TRANSFORMATIONS];
> // Object 0
> #declare TRANSFORMS[0][0] = transform {rotate 90*x translate 5*z};
> #declare TRANSFORMS[0][1] = ...
> // Object 1
> #declare TRANSFORMS[1][0] = transform {rotate 40*x translate 5*z};
> #declare TRANSFORMS[1][1] = ...
I think you can make it more concise:
#declare TRANSFORMS = array[NUM_OBJ][NUM_TRANSFORMATIONS]
{ { transform {rotate 90*x translate 5*z},
transform {rotate 90*x translate 5*z},
...
},
{ transform {rotate 90*x translate 5*z},
transform {rotate 90*x translate 5*z},
...
},
...
};
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> > Christian Froeschlin wrote:
>
> > > #declare TRANSFORMS = array[42];
>
> > actually, since you have multiple objects you probably want
> > this to be something like
>
> > #declare TRANSFORMS = array[NUM_OBJ][NUM_TRANSFORMATIONS];
>
> > // Object 0
> > #declare TRANSFORMS[0][0] = transform {rotate 90*x translate 5*z};
> > #declare TRANSFORMS[0][1] = ...
>
> > // Object 1
> > #declare TRANSFORMS[1][0] = transform {rotate 40*x translate 5*z};
> > #declare TRANSFORMS[1][1] = ...
>
> I think you can make it more concise:
>
> #declare TRANSFORMS = array[NUM_OBJ][NUM_TRANSFORMATIONS]
> { { transform {rotate 90*x translate 5*z},
> transform {rotate 90*x translate 5*z},
> ...
> },
> { transform {rotate 90*x translate 5*z},
> transform {rotate 90*x translate 5*z},
> ...
> },
> ...
> };
>
> --
> - Warp
Thanks guys! I used something in the general notion of what you did.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |