Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://star.arm.ac.uk/~spm/asteroid_impact/asteroid1.html
Дата изменения: Wed Apr 15 18:30:45 1998 Дата индексирования: Tue Oct 2 06:21:36 2012 Кодировка: |
First thing I wanted to do was build something which loked vaguely like an asteroid, Povray has lots of nice geometrical prmitives, but asteroids are messy irregular things. So I hacked together a bit of code to generate asteroids as a mesh of smooth trianlges. The code has an odd history , it was written about a year ago, I gave it to a load of other people and then somehow managed to lose my copy of it. I finally managed to get back a modified copy of it which was then hacked back into shape to get it to work under GCC (and fix a couple of bugs which my friend had introduced).
The program basically works by starting with a low detail object made of 8 triangles and then splitting the largest vertex and displacing it slightly from it's position. It's not optomised for speed or anything fancy like that - after all most of the CPU time will be spent rendering the asteroid - the time I migth save by optomising this won't be noticed.
The asteroid I created has a long axis 1.5 times longer than the other axes.
(You can download an mpeg animation of this rotating by clicking on the image.)
The C source code for the asteroid generator is also available here - you may use it under the terms of the Gnu Public License II - if you've any questions on how to get it working then I might have an answer.....