Changing textures of m3g object by code

Forum for discussion on 3D games for mobile platform and doubts related to M3G, Mascot capsule and other rendering engines.

Changing textures of m3g object by code

Postby prasadmathugama » Mon Jun 21, 2010 2:11 pm

I want to know how to change texture of a object by code. For an example suppose I want to add several textures to a single m3g object each time (like dresses of a player should change according to the country they belong). Please can some one show me a path to do this...
prasadmathugama
 
Posts: 4
Joined: Tue May 04, 2010 8:02 am

Re: Changing textures of m3g object by code

Postby ladty » Thu Jul 29, 2010 12:50 pm

Code: Select all
model.getAppearance(0).setTexture(0, new Texture2D(new Image2D(Image2D.RGB, /* Image */)));


(or Image2D.RGBA etc ;))
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic


Return to 3D Mobile Game (M3G)

Who is online

Users browsing this forum: No registered users and 2 guests