Post by NoVaGene on Jun 25, 2004 7:16:46 GMT -5
AHBanen - Do a "glDisable (GL_DEPTH_TEST)" to disable the z-buffer testing at the start of the program and would fix the line "breaking" problem.
I have taken a look at your post on "Posted on: Jun 23rd, 2004, 05:44am" and its good for animating object about a fix radius. However, my approach can be extended to arbitrary path. If you remove the lines,
angle# = angle# + 1
if angle# >= 360 then angle# = 0: endif
And add to the keyboard "VK_LEFT/RIGHT" statements,
angle#=angle#+1 and angle#=angle#-1 respectively. You can cruise the bird motion which ever direction its heading twds. Do something as this,
if scankeydown(VK_LEFT) then angle#=angle#+1.0
if angle# > 360 then angle# = angle#-360.0: endif
endif
if scankeydown(VK_RIGHT) then angle#=angle#-1.0
if angle# < 0 then angle# = angle# + 360.0: endif
endif
Having shown the 2 scankeydown statements above, i would also like to share a little of my findings regarding the "if angle# > 360 then angle# = angle#-360.0".
In glneo's approach "if angle# >= 360 then angle# = 0" is used. When the angle value = 360 its actually alright to leave it as it is (360/0 has the same result when applied to sin & cos anyway ). But as it reaches 361, its not proper to reset it to 0. It should be angle# = angle# - 360, which angle# equals 1. This subtlety may not be significant for small delta but with larger ones, its noticeable when jerking effect start to show.
For the "matrix" qns, it should be safe to take it as the resultant transformation right before it does the pushmatrix.
Its getting more interesting!
-Lucas Tan-
ps: i would suggest to give a more specific Subject so that its easier to locate questions/solution related to a particular case for future enthusiats.