POV-Ray : Newsgroups : povray.animations : How to animate ??????????????? Server Time
23 Nov 2024 14:44:35 EST (-0500)
  How to animate ??????????????? (Message 1 to 10 of 16)  
Goto Latest 10 Messages Next 6 Messages >>>
From: sitha
Subject: How to animate ???????????????
Date: 21 Nov 2006 01:40:00
Message: <web.45629ea4e8a9e27f4ac3566b0@news.povray.org>
Hi,
I am working in simulation for building response during earthquake. Here
first I explain what type of data I have,
1. mesh data -vertex_vectors
2.texture data(displacement data) - texture_list
3.Elements data- face_indices

Now mesh and element data sets are fixed, but each time texture data is
going to change. Now what I did was made pov files for each texture data,
it means I created 1000 of POV files to visualize and then I made them into
bitmap file, then I made these bitmap files as video clip.

Is there anyway to create a pov file which can animate for changing texture
data?

Pls help me.........

Regards,
Sitha.


Post a reply to this message

From: Stephen
Subject: Re: How to animate ???????????????
Date: 21 Nov 2006 03:50:00
Message: <web.4562bd9886d65c51f1cb1e660@news.povray.org>
"sitha" <nsi### [at] excitecom> wrote:
> Hi,
> I am working in simulation for building response during earthquake. Here
> first I explain what type of data I have,
> 1. mesh data -vertex_vectors
> 2.texture data(displacement data) - texture_list
> 3.Elements data- face_indices
>
> Now mesh and element data sets are fixed, but each time texture data is
> going to change. Now what I did was made pov files for each texture data,
> it means I created 1000 of POV files to visualize and then I made them into
> bitmap file, then I made these bitmap files as video clip.
>
> Is there anyway to create a pov file which can animate for changing texture
> data?
>
> Pls help me.........
>
> Regards,
> Sitha.





You can use the File Queue see (1.5.7.6  File Queue) in the help document to
render a list of files. Or you can use the clock variable or frame_number
variable (3.2.1.3.6  Built-in Variables) to change your textures through
out your annimation.

Stephen


Post a reply to this message

From: sitha
Subject: Re: How to animate ???????????????
Date: 22 Nov 2006 03:20:01
Message: <web.4564071e86d65c514ac3566b0@news.povray.org>
Hi,
Sorry if I dont explain my problem clearly.
Say I want to create 100 frames of bitmap files from a pov file. In the pov
file vertex and face indices are fixed. they will not change. I want to
change each time texture rgb color only. This rgb here I am going to give
the value from my analsis result for each frame. My question is would it be
possible to give the rgb changes in one pov file or I should create pov
files corresponding to the rgb value changes. Bcs now what I did was,
created 100 0f pov fils corresponding to the rgb value.

Pls help me.


Post a reply to this message

From: Stephen
Subject: Re: How to animate ???????????????
Date: 22 Nov 2006 03:50:00
Message: <web.45640ddc86d65c51f1cb1e660@news.povray.org>
"sitha" <nsi### [at] excitecom> wrote:
> Hi,
> Sorry if I dont explain my problem clearly.
> Say I want to create 100 frames of bitmap files from a pov file. In the pov
> file vertex and face indices are fixed. they will not change. I want to
> change each time texture rgb color only. This rgb here I am going to give
> the value from my analsis result for each frame. My question is would it be
> possible to give the rgb changes in one pov file or I should create pov
> files corresponding to the rgb value changes. Bcs now what I did was,
> created 100 0f pov fils corresponding to the rgb value.
>
> Pls help me.

You would think that Pov-Ray was designed for what you want to do :-)
Example: Render using the command line options +kfi1 +kff10

global_settings {
  assumed_gamma 1.0
}

camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>
  color rgb <1, 1, 1>
  translate <-30, 30, -30>
}

plane {
  y, -1
  pigment { color rgb <0.7*(1-clock*clock),0.5*(1-clock),0.3*clock> } /*
clock modifies rgb */
}
sphere {
  0.0, 1
  texture {
  pigment {
    color rgbf <0.7*clock,0.5*(1-clock),0.3*(1-clock*clock), clock> /* clock
modifies rgbf */
  }
    }
  }

// Stephen


Post a reply to this message

From: Chris B
Subject: Re: How to animate ???????????????
Date: 22 Nov 2006 04:18:23
Message: <456415df$1@news.povray.org>
"sitha" <nsi### [at] excitecom> wrote in message 
news:web.4564071e86d65c514ac3566b0@news.povray.org...
> Hi,
> Sorry if I dont explain my problem clearly.
> Say I want to create 100 frames of bitmap files from a pov file. In the 
> pov
> file vertex and face indices are fixed. they will not change. I want to
> change each time texture rgb color only. This rgb here I am going to give
> the value from my analsis result for each frame. My question is would it 
> be
> possible to give the rgb changes in one pov file or I should create pov
> files corresponding to the rgb value changes. Bcs now what I did was,
> created 100 0f pov fils corresponding to the rgb value.
>
> Pls help me.
>

Hi Sitha,

POV-Ray allows you to do it either way. To set the different rgb values 
within a single file (either the scene file or a separate include file) you 
can use the 'frame_number' identifier that Stephen mentioned, which tells 
you the number of the frame being rendered, or the 'clock' float identifier 
which passes from 0 to 1 through the animation, if that is more convenient.

There are lots of ways you could use the information from these identifiers 
to affect the colour value. For example:
  o  You can calculate a colour within the SDL - 'rgb <clock,1-clock,0>' 
will change a colour from green to red as the animation progresses from the 
first to last frame. This doesn't have to be a simple calculation, you can 
use functions, algebra, etc. in the calculation.
  o  You can build a series of #if statements, such as '#if 
(frame_number=123) #local MyColour= pigment {color rgb <1,2,3>}; #end'
  o  You could have a single .csv file (Comma Separated Variables) 
containing all of the colour values you've calculated with one line per 
frame, then you could use the frame_number variable to work out which line 
of the file to read for a particular frame.

The best solution for you is likely to be the easiest and that depends on 
how you're generating the information and how you really need to use it. If 
you are uv mapping your colour values to a mesh, then it may well be best to 
generate one file per frame in the format required for uv mapping, using the 
frame number in the file name. You can then use the 'concat' function along 
with the 'frame_number' identifier to '#include' the appropriate values, 
dynamically building the file name in your SDL.

Hope this helps

Regards,
Chris B.


Post a reply to this message

From: Dave VanHorn
Subject: Re: How to animate ???????????????
Date: 20 Feb 2008 14:35:00
Message: <web.47bc80c786d65c51a08ed15e0@news.povray.org>
>   o  You could have a single .csv file (Comma Separated Variables)
> containing all of the colour values you've calculated with one line per
> frame, then you could use the frame_number variable to work out which line
> of the file to read for a particular frame.


How exactly would this be done?

I have some data in CSV format that I'd like to visualize, but I don't know how
to pull it into variables for each frame.


Post a reply to this message

From: Dave VanHorn
Subject: Re: How to animate ???????????????
Date: 20 Feb 2008 16:05:01
Message: <web.47bc95f886d65c51a08ed15e0@news.povray.org>
Here's what I have so far, which errors on the third line of the data file with
"Parse error: Expected 'float, vector, or string literal',, found instead"



//Initialize with safe values
#declare Lines_In_File = 0;
#declare Xval = 1;
#declare Yval = 1;
#declare Zval = 1;

// Sample data, X, Y, Z
//0.128236817,0.17343048,1.06941009
//-0.109255917,-0.005383651,0.765301253
//0.059836132,0.172405022,0.976029181   <--- Errors on this line


//Find how many lines in the file
#fopen MyFile "drop13.csv" read

#while (defined(MyFile))
  #read (MyFile,Xval,Yval,Zval)
  #declare Lines_In_File=Lines_In_File+1 ;
#end

#fclose MyFile

// Having Lines_In_File now holding the lines count

#declare clock=0;
#declare Count=0;

// Read the Nth line
#declare Read_Line = int((1/Lines_In_File)*clock)
#fopen MyFile "bang.csv" read
#while (defined(MyFile))
 #while (Count<Line)
  #read (MyFile,Xval,Yval,Zval)
  #declare Count=Count+1
 #end
#end
#fclose MyFile


Post a reply to this message

From: Chris B
Subject: Re: How to animate ???????????????
Date: 20 Feb 2008 16:22:17
Message: <47bc9a09@news.povray.org>
"Dave VanHorn" <mic### [at] gmailcom> wrote in message 
news:web.47bc95f886d65c51a08ed15e0@news.povray.org...
>
> Here's what I have so far, which errors on the third line of the data file 
> with
> "Parse error: Expected 'float, vector, or string literal',, found instead"
> ...
>
> // Sample data, X, Y, Z
> //0.128236817,0.17343048,1.06941009
> //-0.109255917,-0.005383651,0.765301253
> //0.059836132,0.172405022,0.976029181   <--- Errors on this line
>
>

If this is what the file looks like it looks like, you're missing commas at 
the end of each line.
POV-Ray disregards the line throws, so I suspect it would read past the 
first doing a subtraction due to the minus sign starting the second line. 
When it hits the end of the second line it'll concatenate two numbers with 
decimal points in both and doesn't know how to handle that.

If the whole file is XYZ coordinates you might want to code it up as vectors 
(depending upon what you want to do with them). e.g:
<0.128236817,0.17343048,1.06941009>,
<-0.109255917,-0.005383651,0.765301253>,
<0.059836132,0.172405022,0.976029181> ,
... etc.

In which case you can read in a single variable containing the coordinates.

Regards,
Chris B.


Post a reply to this message

From: Dave VanHorn
Subject: Re: How to animate ???????????????
Date: 20 Feb 2008 17:10:01
Message: <web.47bca42d86d65c51a08ed15e0@news.povray.org>
> If this is what the file looks like it looks like, you're missing commas at
> the end of each line.

Is there any way to make it work without that?
My data files are >1000 lines, manually fixing it would be awful.


> If the whole file is XYZ coordinates you might want to code it up as vectors
> (depending upon what you want to do with them). e.g:
> <0.128236817,0.17343048,1.06941009>,
> <-0.109255917,-0.005383651,0.765301253>,
> <0.059836132,0.172405022,0.976029181> ,

I don't have any way to make the data come to me in this format.

Maybe a different way to use the #read?

Here's the current version:
//Find how many lines in the file
#fopen MyFile "drop13.csv" read

#while (defined(MyFile))
  #read (MyFile,Xval,Yval,Zval)
  #debug concat("Just read line ", str(Lines_In_File,1,0), "\n")

  #declare  EX=str(Xval,12,9);
  #declare  WY=str(Yval,12,9);
  #declare Zee=str(Zval,12,9);

  #debug concat(EX," ",WY," ",Zee,"\n")

  #declare Lines_In_File=Lines_In_File+1 ;
#end

#fclose MyFile


// Having Lines_In_File now holding the lines count

#declare Count=0;

/*
#declare Read_Line = 1; //int((1/Lines_In_File)*Clock);
#fopen MyFile "drop13.csv" read
#while (defined(MyFile))
 #while (Count<Read_Line)
  #read (MyFile,Xstr,Ystr,Zstr)
  #declare Count=Count+1;
 #end
#end
#fclose MyFile


Here's the debug output:

  Bounding boxes.......On   Bounding threshold: 3
  Light Buffer.........On
  Vista Buffer.........On   Draw Vista Buffer....Off
  Antialiasing.........On  (Method 1, Threshold 0.300, Depth 3, Jitter 1.00)
  Clock value:    0.000  (Animation off)
Just read line 1
 0.128236817  0.173430480  1.069410090
Just read line 2
 0.109255917 -0.005383651  0.765301253
File: drop13.csv  Line: 3
File Context (5 lines):
0.128236817,0.17343048,1.06941009
-0.109255917,-0.005383651,0.765301253
0.059836132,
Parse Error: Expected 'float, vector, or string literal', ,  found instead
Total Scene Processing Times
  Parse Time:    0 hours  0 minutes  0 seconds (0 seconds)
  Photon Time:   0 hours  0 minutes  0 seconds (0 seconds)
  Render Time:   0 hours  0 minutes  0 seconds (0 seconds)
  Total Time:    0 hours  0 minutes  0 seconds (0 seconds)
CPU time used: kernel 0.02 seconds, user 0.05 seconds, total 0.06 seconds

POV-Ray finished


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How to animate ???????????????
Date: 20 Feb 2008 17:12:24
Message: <47bca5c8$1@news.povray.org>

>> If this is what the file looks like it looks like, you're missing commas at
>> the end of each line.
> 
> Is there any way to make it work without that?

No.

> My data files are >1000 lines, manually fixing it would be awful.

Manually? Of course nobody would waste his time doing that *manually*.

Are you on Windows?


Post a reply to this message

Goto Latest 10 Messages Next 6 Messages >>>

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