воскресенье, 9 декабря 2012 г.

Создание нового материала и тагтекстуры.
//***********************************

CreaMat(vDoc)//Функция создания нового материала
{
mat = new(Material); //Create a new material in memory
mat->SetName("par"); // Имя материала
RandCol(vDoc);//Вызов Random-псевдо-случайной функции
mat#MATERIAL_COLOR_COLOR = vector(rd,gr,bl); // Установка цвета в red-green-blue
vDoc->InsertMaterial( mat, NULL ); // Установка нового материала в Material Manager
mat#MATERIAL_PREVIEWSIZE=10; // Higher number=higher editor resolution setting
texTag = AllocTag( Ttexture ); //Create a texture tag for the new sphere
texTag#TEXTURETAG_MATERIAL = mat; //links the newly created material to the texture's Material input field
vOp=vDoc->GetActiveObject(); //Load Selected object into memory
vOp->InsertTag(texTag , NULL); //Add it to the scene
}
//***********************************

Комментариев нет:

Отправить комментарий