www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on April 06, 2016, 09:14:00 am

Title: Texture Mapping
Post by: AGP on April 06, 2016, 09:14:00 am
This isn't a jpct-specific question. I can understand if you don't want to answer it, Egon. But here it goes, anyway: how do I texture map a triangle? Put differently, let's say that I have a sphere and a texture map. How do I figure out which part of the texture map goes with each triangle?
Title: Re: Texture Mapping
Post by: EgonOlsen on April 06, 2016, 09:36:29 am
That highly depends on how you actually want your texture to be applied...spherical, projected...whatever. The ExtendedPrimitives class does support generated texture coordinates for spheres. I can upload the source code of that class if that would help.
Title: Re: Texture Mapping
Post by: AGP on April 06, 2016, 10:40:58 am
It would, thanks very much.
Title: Re: Texture Mapping
Post by: EgonOlsen on April 07, 2016, 09:55:32 am
Here you go: http://www.jpct.net/download/tmp/ExtendedPrimitives.java (http://www.jpct.net/download/tmp/ExtendedPrimitives.java)