About Store Forum Documentation Contact



Post Reply 
change material
Author Message
djpercy Offline
Member

Post: #1
change material
Hello,

How can i change, the matrial on a cube?
I have put a image on the cube. This is my code but it gives me a error when i run it.

PHP Code:
Material material;
   
material.base_0=&rtt;
   
Cube[0].material=&material

Greetings Denis
(This post was last modified: 12-01-2011 07:09 PM by djpercy.)
12-01-2011 07:08 PM
Find all posts by this user Quote this message in a reply
Grabonito Offline
Member

Post: #2
RE: change material
PHP Code:
Material mat;
   
mat.load("mtrl/gleba/0.mtrl");
   
Cube[0].material=&mat
(This post was last modified: 12-02-2011 10:27 AM by Grabonito.)
12-02-2011 10:25 AM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #3
RE: change material
Hello,

Thank you :-) that is not what i should like.
what i will, is a snapshot with a Camera on a Image and this Image is the Material for a Cube or somewhat else.

Greetings Denis
12-02-2011 01:21 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: change material
You need to validate the material first:

Code:
Material material;
material.base_0=&rtt;
material.validate();

Cube[0].material=&material;
12-03-2011 01:35 AM
Find all posts by this user Quote this message in a reply
djpercy Offline
Member

Post: #5
RE: change material
Hello,

Thanks, The poblem is not the texture it was my object about the default material. I down't know why. I have chage the Default material and it works.

Greetings Denis
12-04-2011 12:07 PM
Find all posts by this user Quote this message in a reply
Post Reply