| delorie.com/archives/browse.cgi | search |
| From: | Timo Asikainen <thka AT lyseo DOT edu DOT ouka DOT fi> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Problems with Allegro's texturemapping |
| Date: | Sun, 12 Jul 1998 18:03:58 -0700 |
| Organization: | Oulu Polytechnic, Institute of Technology, Finland |
| Lines: | 27 |
| Message-ID: | <35A95CFE.2518@lyseo.edu.ouka.fi> |
| Reply-To: | thka AT lyseo DOT edu DOT ouka DOT fi |
| NNTP-Posting-Host: | anne86.wnet.opoy.fi |
| Mime-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
I'm programming a landscape engine for a game. The method I use is simple: I have a mesh in which all vertices have a height. These vertices are connected to each other by lines which form triangles. (Here's a nice ASCII pic:-)) +-+-+-+ |\|\|\| +-+-+-+ |\|\|\|<---- a triangle +-+-+-+<-----a vertex Now, what I try to do is texturemap these triangles. I want to texturemap them so that I can map a big photograph of for example grass or rock onto this landscape. Or if the texture is a small one (for example 64x64) I could tile it on the landscape. The problem is that in Allegro I have to calculate proper texturemap coords. for each vertex of a triangle and I don't know any good algorithm for calculating the texmap coords. so that I could achieve what I want to do. If anyone knows any good netsites on the subject or have some good algorithms please let me know about them.. ------ Timo Asikainen
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |