POV-Ray : Newsgroups : povray.binaries.animations : 3D-Studio-Max partical to PovRay-array script here Server Time
2 May 2024 01:41:01 EDT (-0400)
  3D-Studio-Max partical to PovRay-array script here (Message 1 to 1 of 1)  
From: H  Karsten
Subject: 3D-Studio-Max partical to PovRay-array script here
Date: 6 Dec 2010 15:35:04
Message: <web.4cfd479a44ea0bd8a3bfeb720@news.povray.org>
Hi People,
I've wrote a little script that converts Max-particle to Povray-Arrays.

You need to follow a view rules to use it:
- Use only triangles as particles in Max (so only use particle-systems, able for
you to chose the type of particle)
- best is to scale the particle down to zero-units, so every triangle of the
particle is in the same place. (the result then in PovRay is exactly the same
positon of each particle then)


In this example XVid .avi-file I used a blob object + a sphere for each
particle, using random radius (same seed for the spheres and the
blob-components)

here the max-script:
################################################################################
basename = getSaveFileName caption:"Basename"
if(basename != undefined)then
(
scale = 1
for frame = animationrange.start to animationrange.end do
(
filename = basename + "_" + frame as string + ".inc"
output_file = createfile filename
at time frame tmesh = snapshotAsMesh selection[1]
format "#declare blb=array[" to:output_file
format "%]\n" (tmesh.numverts/3) to:output_file
for v = 1 to tmesh.numverts/3 do
(
vert = getVert tmesh (v*3)
format "#declare blb[%]=<%,%,%>;\n" (v-1) (vert.x*scale) (vert.y*scale)
(vert.z*scale) to:output_file
)
close output_file
)
)
################################################################################


Post a reply to this message


Attachments:
Download 'blob.avi.dat' (4091 KB)

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