imageBestRatio

Synopsis

string imageBestRatio(string searchQuery, string axisSelector)

Parameters

Returns

Returns texture with best ratio match (according to axisSelector).

This function returns the texture with the best ratio match, from the list specified in searchQuery, according to the specified combination of axes.

Note: In case multiple files share the best ratio, a random file is returned among those

Related

Examples

Setting up texturing based on the best pixel ratio

The goal is to set up the texturing, depending on the best pixel ratio of the list of desired textures. The following textures all have different resolutions.



CGA example:

Lot --> s('.9,'.9,'.9) center(xz) recursiveSplit(0)
recursiveSplit(n) -->
	case scope.sx >= 1.5 && scope.sz >= 1.5:
		split(x){~scope.sx/3: split(z){~scope.sz/3: recursiveSplit(n+1)}*}*
	else: doTexturing
doTexturing -->
	set(material.colormap, imageBestRatio("/myProject/assets/textures/*.jpg", "xz"))
	setupProjection(0, scope.xz, scope.sx, -scope.sz)
	projectUV(0)

Copyright ©2008-2016 Esri R&D Center Zurich. All rights reserved.