Friday, October 24, 2008

Christmas tree

As wrote yesterday, i'm working on mesh.. the objective is to use blender, the 3d editor, for create the objects like the space station, but also to add, easily, some points of interest that will not be drawed but used like reference instead.
For example to represent the points on a starship hull where i can attach or detach my weapons.
Or to represent the strobo lights positions on the space station.
To do this i've used a trick: when i want to add for example the strobo lights on the space station, i add a cluster of points using blender: each point represent a strobo light.
Then, i assign a special texture to the cluster and export.
When i read the data from Tau Ceti, i scan the mesh, and when i find the "special" texure, i don't draw the cluster but i read each point of it and use it to display a light on the corresponding position.
Look for this example: i've assumed that ALL the space station are made of special points.. the results looks like an christmas tree :)

---

Come vi ho detto ieri sto lavorando sulle mesh, in particolar modo sto cercando un modo comodo per aggiungere delle posizioni "speciali" all'interno degli oggetti 3D, un'insieme di coordinate che rappresentano non i soliti vertici dei triangoli ma bensi' delle posizioni da utilizzare per altri scopi. Per esempio in un'astronave i punti di aggancio nello scafo per le varie armi. Oppure nella stazione spaziale i punti nei quali devono apparire le luci stroboscopiche.
Il metodo piu' comodo e' senz'altro quello di usare blender stesso per posizionare i punti di interesse in maniera visuale mentre disegno la mesh. Il trucco sta nel assegnare poi ai punti speciali una texture particolare, anche totalmente nera, ma che mi permette poi da programma di riconoscere il gruppo di punti dal normale insieme di triangoli che compone l'oggetto.
I punti speciali non li disegno ma utilizzo le loro coordinate per attaccare le armi, visualizzare le luci stroboscopiche eccetera.

Vi lascio con un esempio: ho preso la stazione spaziale e ho provato a marcare tutti i vertici come posizione di una luce stroboscopica.
L'effetto finale e' l'albero di natale che vedete qui sotto :)


No comments: