A vxlTexture is a representation of a raster image in Voxelent.
A vxlTexture is a representation of a raster image in Voxelent. Textures can be loaded providing a URI
To set the magnification and minification filters for a texture please refer to the constants
defined in vxl.def.texture.filter. A vxlTexture object uses the min and
mag properties to set these filters. For example:
var texture = new vxlTexture('iphone_screen.png');
texture.min = vxl.def.texture.filter.LINEAR;
texture.mag = vxl.def.texture.filter.NEAREST;
The maginfication and minification filters by default are: vxl.def.texture.filter.LINEAR and vxl.def.texture.filter.LINEAR_MIPMAP_LINEAR respectively
Under normal circumstances you will not need to create a vxlTexture. An actor representing a model with texture information in it will create a vxlTexture automatically. In this case you can access the available vxlTexture object from the actor like this:
var actor = vxl.c.scene.getActorByName('iphone_screen.json');
actor.texture.min = [set the filter here using the constants defined in vxl.def.texture.filter]
actor.texture.mag = [set the filter here using the constants defined in vxl.def.texture.filter]
If you want to replace the texture object with a new raster image, you can write something like this:
var actor = vxl.c.scene.getActorByName('iphone_screen.json');
var wallpaper = new vxlTexture('new_wallpaper.png');
actor.setTexture(wallpaper);
Parameters:
| String |
uri
|
texture location |
Parameters:
| Type | Name | Description |
|---|---|---|
| Object |
gl
|
the gl context |
Parameters:
| Type | Name | Description |
|---|---|---|
| Object |
gl
|
the gl context |
Parameters:
| Type | Name | Description |
|---|---|---|
| Object |
uri
|
the location of the image to load into this texture object |
Parameters:
| Type | Name | Description |
|---|---|---|
| String |
magfilter
|
one of the options in vxl.def.texture.filter |
See: