Multiple Format File Converter

Discussions about the use of Realflow in other Software Packages
User avatar
Posts: 11
Joined: Tue Mar 18, 2008 12:51 pm

Multiple Format File Converter

Postby Swann » Sun Aug 15, 2010 8:22 pm


I started recently to write coverter that allows to exchange data between different file formats.

Just started to code RF particle Bin format.
Below you can see first couple of lines from specification pdf of this format.

Code: Select all

(Begin of file)
[long int] ; verification code = 0xFABADA
[char]*250 ; fluid name
[short int] ; version (current = 11)
[float] ; scale scene
[int] ; fluid type
[float] ; elapsed simulation time
[int] ; frame number
[int] ; frames per second
[long int] ; number of particles
[float] ; radius
[float]*3 ; pressure (max, min, average)
[float]*3 ; speed (max, min, average)
[float]*3 ; temperature (max, min, average)
[float]*3 ; emitter position ;; version>=7
[float]*3 ; emitter rotation ;; version>=7
[float]*3 ; emitter scale ;; version>=7

What I'm curious is that there is no loop that test is there more than one fluid in the scene. My example file that I'm working on contains 3 fluids. But if I read and print to console information from this file I get name and number of particles of only one fluid (if I noticed correctly it wil be the last emmiter that was added to scene).

Here is begin of file printed to conole:

Every data is correct here for this emmiter but in scene there are three emitters and after this part of specification there are is loop that loops thru number of particles, but how this can be correct if this specification doesn't count how many fluids are in scene so it doesn't get all particles that are in scene ?

Below you can see next part of specification that starts directly after part I postet above:

Code: Select all

-> loop for <number of particles>
[float]*3 ; particle position (XYZ-global)
[float]*3 ; particle velocity (XYZ)
[float]*3 ; particle force (XYZ)
[float]*3 ; particle vorticity (XYZ) ;; version>=9
[float]*3 ; normal vector (XYZ) ;; version>=3
[int] ; number of neighbors ;; version>=4
[float]*3 ; Texture vector (UVW) ;; version>=5
[short int] ; info bits ;; version>=5
[float] ; elapsed particle time (age)
[float] ; isolation time
[float] ; viscosity
[float] ; density
[float] ; pressure
[float] ; mass
[float] ; temperature
[int] ; particle ID
-> end loop

and you can see that it loops thru number of particles. Why not thru all particles that are in the scene ? Why only thru particles of one emitter ?

Thanks for any tips.

Return to “Others”

Who is online

Users browsing this forum: No registered users and 1 guest