|
|
testing a macro to subdivide triangles along two splines, with UV mapping.
(no smooth triangles where used)
jaap.
---------------------------------------------------------
#declare splineBot = spline {
cubic_spline
-1, < 60, -20,0>
0, < 40, -70,0>
1, < 0,-110,0>
2, < -60, -90,0>
3, <-100, -40,0>
4, <-110, 30,0>
5, < -60, 100,0>
6, < 10, 70,0>
7, < 20, 30,0>
}
#declare splineTop = spline {
cubic_spline
-1, < 60, -20,30>
0, < 40, -70,30>
1, < 0,-110,30>
2, < -60, -90,30>
3, <-100, -40,30>
4, <-110, 30,30>
5, < -60, 100,30>
6, < 10, 70,30>
7, < 20, 30,30>
}
// -0-------1-------2-------3-------4-------5-------6- =splineTop
// V 1 1---2 1 1---2 1 1---2 1 1---2 1 1---2 1 1---2
// ^ |\ \ B| |\ \ B| |\ \ B| |\ \ B| |\ \ B| |\ \ B|
// | | \ \ | | \ \ | | \ \ | | \ \ | | \ \ | | \ \ |
// | |A \ \| |A \ \| |A \ \| |A \ \| |A \ \| |A \ \|
// | 2---3 3 2---3 3 2---3 3 2---3 3 2---3 3 2---3 3
// -0-------1-------2-------3-------4-------5-------6- =splineBot
//
// 0 ------> U
#declare frames= 6; // number of frames
#declare parts = 1; // parts per frame (1..10 1=no sub devision)
mesh{
#local frameNr = 0.0;
#while(frameNr < frames)
#local part = 0.0;
#while(part < parts)
#local partStart = part/parts;
#local partEnd = partStart+(1/parts);
triangle { // A:
splineTop(frameNr+partStart),
splineBot(frameNr+partStart),
splineBot(frameNr+partEnd )
uv_vectors <partStart,1>, <partStart,0>, <partEnd,0>
}
triangle { // B:
splineTop(frameNr+partStart),
splineTop(frameNr+partEnd ),
splineBot(frameNr+partEnd )
uv_vectors <partStart,1>, <partEnd ,1>, <partEnd,0>
}
#local part = part + 1.0;
#end
#local frameNr = frameNr + 1.0;
#end
texture {
uv_mapping
pigment { image_map { png "frame.png" interpolate 2 filter all 1.0 } }
finish {
diffuse 0.8
reflection 0.2
}
}
}
Post a reply to this message
Attachments:
Download 'film.jpg' (213 KB)
Preview of image 'film.jpg'
|
|
|
|
update:
-manipulating two splines in 3D was to hard (top and bottom ege of film),
so now there is a single spline thrue the center of the film, and the top
and bottom edges are calculated (spline must always be curved!)
-using macro's. (i tryed making a user defined function that returns a
vector,
but this dous not seem to be possible)
-frame start/end is not longer linked to the control points of the spline,
you can use any distance between control points, and set the frame size
independently. (the frames are no longer counted, you will have to add
this
in case you want to texture each frame differently)
-using smooth_triangle, witch calculated normals, becouse the reflections
looked bad, even with 20 parts/frame.
-code cleanup.
source: http://jwstolk.afreehost.net/film_test_2.pov.gz
going to try HDR lighting now...
Jaap.
Post a reply to this message
Attachments:
Download 'film_test_2.jpg' (81 KB)
Preview of image 'film_test_2.jpg'
|
|