Material

Inheritance: java.lang.Object, com.aspose.threed.A3DObject

All Implemented Interfaces: java.lang.Iterable

public abstract class Material extends A3DObject implements Iterable<TextureSlot>

Material definisce i parametri necessari per l’aspetto visivo della geometria. Aspose.3D fornisce il modello di shading per LambertMaterial, PhongMaterial e ShaderMaterial Example:

var mat = new LambertMaterial();
     var tex = new Texture();
     tex.setFileName("diffuse.png");
     mat.setTexture(Material.MAP_DIFFUSE, tex);
     for(var slot : mat)
     {
         System.out.printf("Texture slot %s = %s", slot.getSlotName(), slot.getTexture());
     }

Campi

CampoDescrizione
MAP_AMBIENTUsato in setTexture per assegnare una mappatura di texture ambientale.
MAP_DIFFUSEUsato in setTexture per assegnare una mappatura di texture diffusa.
MAP_EMISSIVEUsato in setTexture per assegnare una mappatura di texture emissiva.
MAP_NORMALUsato in setTexture per assegnare una mappatura di texture normale.
MAP_SPECULARUsato in setTexture per assegnare una mappatura di texture speculare.

Metodi

MetodoDescrizione
equals(Object arg0)
findProperty(String propertyName)Trova la proprietà.
getClass()
getName()Ottiene il nome.
getProperties()Ottiene la collezione di tutte le proprietà.
getProperty(String property)Ottieni il valore della proprietà specificata
getTexture(String slotName)Ottiene la texture dallo slot specificato, può essere il nome della proprietà del materiale o il nome del parametro dello shader
hashCode()
iterator()Ottiene l’enumeratore per enumerare gli slot di texture interni.
notify()
notifyAll()
removeProperty(Property property)Rimuove una proprietà dinamica.
removeProperty(String property)Rimuove la proprietà specificata identificata per nome
setName(String value)Imposta il nome.
setProperty(String property, Object value)Imposta il valore della proprietà specificata
setTexture(String slotName, TextureBase texture)Imposta la texture allo slot specificato
toString()Formatta l’oggetto in stringa
wait()
wait(long arg0)
wait(long arg0, int arg1)

MAP_AMBIENT

public static final String MAP_AMBIENT

Usato in setTexture per assegnare una mappatura di texture ambientale.

MAP_DIFFUSE

public static final String MAP_DIFFUSE

Usato in setTexture per assegnare una mappatura di texture diffusa.

MAP_EMISSIVE

public static final String MAP_EMISSIVE

Usato in setTexture per assegnare una mappatura di texture emissiva.

MAP_NORMAL

public static final String MAP_NORMAL

Usato in setTexture per assegnare una mappatura di texture normale.

MAP_SPECULAR

public static final String MAP_SPECULAR

Usato in setTexture per assegnare una mappatura di texture speculare.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParametroTipoDescrizione
arg0java.lang.Object

Returns: boolean

findProperty(String propertyName)

public Property findProperty(String propertyName)

Trova la proprietà. Può essere una proprietà dinamica (creata con CreateDynamicProperty/SetProperty) o una proprietà nativa (identificata per nome).

Parameters:

ParametroTipoDescrizione
propertyNamejava.lang.StringNome della proprietà.

Returns: Property - The property.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getName()

public String getName()

Ottiene il nome.

Returns: java.lang.String - il nome.

getProperties()

public PropertyCollection getProperties()

Ottiene la collezione di tutte le proprietà.

Returns: PropertyCollection - the collection of all properties.

getProperty(String property)

public Object getProperty(String property)

Ottieni il valore della proprietà specificata

Parameters:

ParametroTipoDescrizione
proprietàjava.lang.StringNome della proprietà

Returns: java.lang.Object - Il valore della proprietà trovata

getTexture(String slotName)

public TextureBase getTexture(String slotName)

Ottiene la texture dallo slot specificato, può essere il nome della proprietà del materiale o il nome del parametro dello shader

Parameters:

ParametroTipoDescrizione
slotNamejava.lang.StringNome slot.

Returns: TextureBase - The texture. Example:

var mat = new LambertMaterial();
     var tex = new Texture();
     tex.setFileName("diffuse.png");
     mat.setTexture(Material.MAP_DIFFUSE, tex);
     tex = (Texture)mat.getTexture(Material.MAP_DIFFUSE);

hashCode()

public native int hashCode()

Returns: int

iterator()

public Iterator<TextureSlot> iterator()

Ottiene l’enumeratore per enumerare gli slot di texture interni.

Returns: java.util.Iterator<com.aspose.threed.TextureSlot>

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeProperty(Property property)

public boolean removeProperty(Property property)

Rimuove una proprietà dinamica.

Parameters:

ParametroTipoDescrizione
propertyPropertyQuale proprietà rimuovere

Returns: boolean - true se la proprietà è stata rimossa con successo

removeProperty(String property)

public boolean removeProperty(String property)

Rimuove la proprietà specificata identificata per nome

Parameters:

ParametroTipoDescrizione
proprietàjava.lang.StringQuale proprietà rimuovere

Returns: boolean - true se la proprietà è stata rimossa con successo

setName(String value)

public void setName(String value)

Imposta il nome.

Parameters:

ParametroTipoDescrizione
valorejava.lang.StringNuovo valore

setProperty(String property, Object value)

public void setProperty(String property, Object value)

Imposta il valore della proprietà specificata

Parameters:

ParametroTipoDescrizione
proprietàjava.lang.StringNome della proprietà
valorejava.lang.ObjectIl valore della proprietà

setTexture(String slotName, TextureBase texture)

public void setTexture(String slotName, TextureBase texture)

Imposta la texture allo slot specificato

Parameters:

ParametroTipoDescrizione
slotNamejava.lang.StringNome slot.
textureTextureBase
var mat = new LambertMaterial();
     var tex = new Texture();
     tex.setFileName("diffuse.png");
     mat.setTexture(Material.MAP_NORMAL, tex);
``` |

### toString() {#toString--}

public String toString()



Formatta l'oggetto in stringa

**Returns:**
java.lang.String - Stringa dell'oggetto
### wait() {#wait--}

public final void wait()





### wait(long arg0) {#wait-long-}

public final void wait(long arg0)





**Parameters:**
| Parametro | Tipo | Descrizione |
| --- | --- | --- |
| arg0 | long |  |

### wait(long arg0, int arg1) {#wait-long-int-}

public final void wait(long arg0, int arg1)





**Parameters:**
| Parametro | Tipo | Descrizione |
| --- | --- | --- |
| arg0 | long |  |
| arg1 | int |  |