Reply To: Cylinder texture alignment

Home Forums Problems and solutions in GDL 3D modelling Cylinder texture alignment Reply To: Cylinder texture alignment

#18451
Barry Kelly
Participant

I just had a bit of a Friday afternoon play and it can be done.


DEFINE TEXTURE 'side' 'Decking 1.jpg',
1,0.75,1,0
DEFINE MATERIAL 'sidematl' 24,
0.9,0.9,0.9, !RGB
0,61,IND(TEXTURE, 'side')

DEFINE TEXTURE 'top' 'Test image.jpg',
1,1,1,0
DEFINE MATERIAL 'topmatl' 24,
0.9,0.9,0.9, !RGB
0,61,IND(TEXTURE, 'top')

BODY -1

CPRISM_ "topmatl", "topmatl", "sidematl",
7, 1.5,
	0.5,       0.0,      11+64, 
	0,       0.0,    900, 
	   0,          180,   4011+64, 
   -0.5,       0.0,      11+64, 
	0,       0.0,    900, 
	   0,          180,   4011+64, 
	0.5,       0.0,     -1

VERT 0.5,0.5,0 !Origin	!!x&y moved 0.5 to centre image
VERT 1.5,0.5,0 !X direction
VERT 0.5,1.5,0 !Y direction
VERT 0.5,0.5,1 !Z direction
COOR 2+256+1024,1,2,3,4

BODY -1

I just used a decking jpg for the bark (so I could see it was straight) and I found a ‘test’ jpg that was round like the rings of a log, as I didn’t have an image of rings to hand.

I used the ‘Box’ wrap method as that seemed to work best for the side texture and moved the origin to centre the circular image.
I wasn’t having much luck using the ‘Cylindrical’ wrap, it always seems to be straight and didn’t radiate from the origin, and then the sides didn’t map nicely either.
Might try again properly later.

Barry.

Attachments:

Versions 6.5 to 22
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit