|
|
Compare these two frames from an animation of a roller coaster I'm
working on. Notice that in the second frame, the track spine has
disappeared.
Throughout the animation, the track spine disappears randomly for 1-3
frames at a time. What would cause this?
The spine is a sphere_sweep generated through SDL using bezier data.
Sphere_sweeps are generated by using some macros from transform.inc to
orient the components of the sphere_sweep to the current track heading
and banking.
I don't understand why it would disappear in some frames though,
considering that NONE of the SDL for the sphere_sweep looks at the clock
variable at all. Its generated on every frame and should be the same on
every frame.
The only thing I can possibly think of is rounding errors. But if that
was the case, then the other two rails should be messing up as well. I
suppose I could post the code:
#declare xx = 0;
#while (xx < NUMBEZIERS -1 )
#declare yy = 0;
#while (yy < POINTSPERBEZIER)
GetBezier(bez[xx],c2[xx],c1[xx+1],bez[xx+1], yy/POINTSPERBEZIER, ret)
#declare point1 = ret;
GetBezier(bez[xx],c2[xx],c1[xx+1],bez[xx+1], yy/POINTSPERBEZIER + 0.001,
ret)
#declare point2 = ret;
#declare point3 = point2 - point1;
#declare il = int(xx);
#declare b = -((bank[xx+1] - bank[xx]) * (yy/POINTSPERBEZIER) + bank[xx]);
#declare raxis = vaxis_rotate(y,point3,b);
#declare bpsl[xx*POINTSPERBEZIER + yy] = VPerp_To_Plane(raxis,point3) *
0.5 + point1;
#declare bpsr[xx*POINTSPERBEZIER + yy] = VPerp_To_Plane(raxis,point3) *
-0.5 + point1;
#declare bpsc[xx*POINTSPERBEZIER + yy] = -0.2*raxis + point1;
#declare yy = yy + 1;
#end
#declare xx = xx + 1;
#end
sphere_sweep { linear_spline (NUMBEZIERS-1)*POINTSPERBEZIER - 1
#declare xx =0;
#while (xx < (NUMBEZIERS-1)*POINTSPERBEZIER -1 )
bpsl[xx], 0.0725
#declare xx=xx+1;
#end
pigment { color rgb x+y }
}
sphere_sweep { linear_spline (NUMBEZIERS-1)*POINTSPERBEZIER - 1
#declare xx =0;
#while (xx < (NUMBEZIERS-1)*POINTSPERBEZIER -1 )
bpsr[xx], 0.0725
#declare xx=xx+1;
#end
pigment { color rgb x+y }
}
sphere_sweep { linear_spline (NUMBEZIERS-1)*POINTSPERBEZIER - 1
#declare xx =0;
#while (xx < (NUMBEZIERS-1)*POINTSPERBEZIER -1 )
bpsc[xx], 0.2023
#declare xx=xx+1;
#end
pigment { color rgb x+y }
}
(END OF CODE)
bez, c1, and c2 are bezier data. GetBezier is a macro for getting the
coordinates in space of a point on a bezier at T. bpsl, bpsr, and bpsc
are of the course the generated sphere_sweep points for the left, right,
and center rails respectively.
Post a reply to this message
Attachments:
Download 'bezier0186.png' (26 KB)
Download 'bezier0185.png' (29 KB)
Preview of image 'bezier0186.png'
Preview of image 'bezier0185.png'
|
|