VS85 Team's profileXNALearnersBlogListsGuestbook Tools Help

Blog


    12/6/2007

    Tutorial sulla Geometria!

    Salve a tutti, sono Giuseppe Maggiore e sono qui impegnato per dare la stura ad un evento storico: il nostro primo video-tutorial ufficiale. Speriamo di avviare un trend di una certa lunghezza!

    Bene, concluse le celebrazioni, diciamo un po' cosa fa questo tutorial: mostriamo un primo esempio basilare di come mandare geometria in wireframe sullo schermo, in 2D, come nell'immagine qui sotto:

    screenshot1

    per fare cio' ci servira' un VertexBuffer, ossia un puntatore a della memoria video appositamente creata per contenere i vertici che, a tre a tre, comporranno il nostro oggetto. Nell'esempio di sopra, il VertexBuffer contiene 6 vertici differenti, e il suo contenuto e' rappresentato qui sotto:

    quad vb

    quad

    Purtroppo pero' stiamo facendo qualcosa di non raccomandabile: stiamo memorizzando i vertici della diagonale ben due volte, sprecando la nostra preziosa memoria video! Possiamo allora evitare di memorizzare le ripetizioni, specificando un ulteriore oggetto, il cosiddetto IndexBuffer, che descrive quali triplette di vertici vanno prese per costruire i nostri triangoli:

    quad vb ib

     

    Nella seconda parte del videotutorial creiamo anche una classe, BasicMesh, per semplificarci la vita nel trattare oggetti (appunto, le Mesh) composti da un Vertex e da un IndexBuffer.

    I link al file video sono a maggiore risoluzione, ma qui trovate un embedding low-res del videotutorial:

     

    Comments (1)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Picture of Anonymous
    Ciccio wrote:
    Grande! Si sente la mancanza di tutorial per XNA in italiano! Continuate così! Ne volgiamo ancora! :)
    Jan. 17

    Trackbacks

    The trackback URL for this entry is:
    http://vs85team.spaces.live.com/blog/cns!B49FFA0EB319A219!195.trak
    Weblogs that reference this entry
    • None