Is it possible to scale or rotate the texture of a single sub-element separately using RhinoCommon?
say, I have a box with a texture
can i scale the texture of only one brep face?
currently it scales the texture for the entire object.
if (res == GetResult.Object)
{
objRef = gObject.Object(0);
obj = objRef.Object();
if (m_subelement && objRef.GeometryComponentIndex.ComponentIndexType == ComponentIndexType.BrepFace)
{
var brepFaceMaterial = obj.GetMaterial(objRef.GeometryComponentIndex);
objRenderMaterial = brepFaceMaterial.RenderMaterial;
}
else
{
objRenderMaterial = obj.RenderMaterial;
}
}
// get the texture from the rendermaterial
var texture = objRenderMaterial.GetTextureFromUsage(RenderMaterial.StandardChildSlots.Diffuse);
var oldRepeatVector = Texture.GetRepeat();
var newRepeatVector = ; // calculate the new vector here
// set the scale
TextureUtils.SetTextureScaling(Texture, newRepeatVector );
doc.Views.Redraw();
If possible, what would be the best way to achieve this? (Scaling and Rotation of single sub-element’s texture).
do i have to make a copy of the rendermaterial, assign it to the brepface and then scale it ?
Thanks