www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: dear_stephen on March 23, 2007, 12:28:04 pm

Title: Rotate Texture
Post by: dear_stephen on March 23, 2007, 12:28:04 pm
Hi

I would like to create an object with a texture mappling as showen in the image below. Projecting an image from the top onto a plain is no problem but I would like to project it from the side. Can someone please tell me what I am missing?

cheers

(http://www.fluidforms.at/tmp/earth.jpg)
Title: Re: Rotate Texture
Post by: EgonOlsen on March 23, 2007, 04:12:52 pm
I think you would have to create additional textures that represent the side view. I can't think of a way to derive that view from the actual terrain texture ATM.
Title: Re: Rotate Texture
Post by: Melssj5 on March 23, 2007, 04:44:25 pm
Well, matbe you need to adjust that on your model before exporting it as 3DS. Which 3d modeler are you using?
Title: Re: Rotate Texture
Post by: dear_stephen on March 23, 2007, 04:55:25 pm
I am creating the mesh with code. My first attempt was using a plain and just assigning a texture but without finding a way to rotate the texture I have created the mesh myself using u v texture mapping. It is sort of working but I seem to have some rounding errors or some other mistake.

The v coordinate should be the y value of the vertex.

(http://www.fluidforms.at/tmp/TexturingError.jpg)
Title: Re: Rotate Texture
Post by: EgonOlsen on March 23, 2007, 05:04:26 pm
How is this supposed to look? The lines should all be in parallel, i asume?
Title: Re: Rotate Texture
Post by: dear_stephen on March 23, 2007, 05:33:44 pm
Sorry for the lack of explanation. The mistake was that I was giving the bottom of the block a v of 0 even though it had a y<0, hence the error.

Here is the final result which I am very pleased with. I think I am going to be using JPCT a lot more in future.

(http://www.fluidforms.at/tmp/WorkingJPCT.jpg)
Title: Re: Rotate Texture
Post by: EgonOlsen on March 23, 2007, 07:42:21 pm
Looks nice! What exactly is its purpose? Some kind of scientific visualization?
Title: Re: Rotate Texture
Post by: dear_stephen on March 28, 2007, 03:29:15 pm
No quite :) It's a fruit bowl routered out of a piece of wood.

Soon you will be able to choose your favourate part of the earth and have it turned into a bowl like the one above.

It will be available on http://www.fluidforms.at (http://www.fluidforms.at) in the next month.