Spaces:
Running
Running
File size: 3,051 Bytes
6cd9596 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
import {
Material,
LoadingManager,
Mapping,
EventDispatcher,
BufferGeometry,
Side,
Texture,
Vector2,
Wrapping
} from '../../../src/Three';
export interface MaterialCreatorOptions {
/**
* side: Which side to apply the material
* THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide
*/
side?: Side;
/*
* wrap: What type of wrapping to apply for textures
* THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping
*/
wrap?: Wrapping;
/*
* normalizeRGB: RGBs need to be normalized to 0-1 from 0-255
* Default: false, assumed to be already normalized
*/
normalizeRGB?: boolean;
/*
* ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's
* Default: false
*/
ignoreZeroRGBs?: boolean;
/*
* invertTrProperty: Use values 1 of Tr field for fully opaque. This option is useful for obj
* exported from 3ds MAX, vcglib or meshlab.
* Default: false
*/
invertTrProperty?: boolean;
}
export class MTLLoader extends EventDispatcher {
constructor(manager?: LoadingManager);
manager: LoadingManager;
materialOptions: MaterialCreatorOptions;
path: string;
texturePath: string;
crossOrigin: boolean;
load(url: string, onLoad: (materialCreator: MaterialCreator) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
parse(text: string) : MaterialCreator;
setPath(path: string) : void;
setTexturePath(path: string) : void;
setBaseUrl(path: string) : void;
setCrossOrigin(value: boolean) : void;
setMaterialOptions(value: MaterialCreatorOptions) : void;
}
export interface MaterialInfo {
ks?: number[];
kd?: number[];
ke?: number[];
map_kd?: string;
map_ks?: string;
map_ke?: string;
norm?: string;
map_bump?: string;
bump?: string;
map_d?: string;
ns?: number;
d?: number;
tr?: number;
}
export interface TexParams {
scale: Vector2;
offset: Vector2;
url: string;
}
export class MaterialCreator {
constructor(baseUrl?: string, options?: MaterialCreatorOptions);
baseUrl : string;
options : MaterialCreatorOptions;
materialsInfo : {[key: string]: MaterialInfo};
materials : {[key: string]: Material};
private materialsArray : Material[];
nameLookup : {[key: string]: number};
side : Side;
wrap : Wrapping;
setCrossOrigin( value: boolean ) : void;
setManager( value: LoadingManager ) : void;
setMaterials( materialsInfo: {[key: string]: MaterialInfo} ) : void;
convert( materialsInfo: {[key: string]: MaterialInfo} ) : {[key: string]: MaterialInfo};
preload() : void;
getIndex( materialName: string ) : Material;
getAsArray() : Material[];
create( materialName: string ) : Material;
createMaterial_( materialName: string ) : Material;
getTextureParams( value: string, matParams: any ) : TexParams;
loadTexture(url: string, mapping?: Mapping, onLoad?: (bufferGeometry: BufferGeometry) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): Texture;
}
|