Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


texturing a cylinder with multiple texture.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 AhmedCoeia   Members   -  Reputation: 374

Like
0Likes
Like

Posted 30 September 2013 - 01:18 PM

I have one cylinder and I would like to texture it using 36 different bitmaps. 

The problem that If i texture the cylinder with just one texture, I see that is stretched, like the picture here : 

  

   // 90, 90, are top radius, down radius, 50 is the height, 60 segements w, 60 segments height.

  reel = new CylinderGeometry(90,90,50,60,60,false,false,true);
 
  var textureBase2:Texture2DBase = new BitmapTexture(new reelTexture().bitmapData);
   
matrial_Reel = new TextureMaterial(textureBase2);
   
matrial_Reel.bothSides true;
   
   
reelMesh = new Mesh(reelmatrial_Reel);
   
reel null;
   
   
reelMesh.mouseEnabled true;

 

 

I would like also to put different textures one down the other, but to group them into one large texture, the problem is with the co-ordinates. 

I use the following code but still I get two pictures overlap each other

 

public static const SIZE int 1024;
public var 
img1 Bitmap;
public var 
img2 Bitmap;

var 
bmp:BitmapData=new BitmapData(SIZE,SIZE,false,0);

//Draw img1 at 0,0
bmp.draw(img1); 

//Draw img2 at 512,0
bmp.draw(img2, new Matrix(1,0,0,1SIZE/20)); 

Attached Thumbnails

  • gte (1).png

Edited by AhmedCoeia, 30 September 2013 - 01:20 PM.


Sponsor:

#2 Goran Milovanovic   Members   -  Reputation: 1104

Like
1Likes
Like

Posted 04 October 2013 - 11:40 AM

Well, you need to properly "unwrap" your geometry, so that things align properly.

 

Search for "UV unwrapping", and you should find relevant information.


+---------------------------------------------------------------------+

| Game Dev video tutorials  ->   http://www.youtube.com/goranmilovano |
+---------------------------------------------------------------------+




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS