Projected texture via ruby API

Hi all,

I have trouble to understand how to use projected texture with ruby API.

I have:

  • a face with a projected texture (from the top view) , inside the model.
  • and a group with the same transformation (axe and origine) with one face inside.

I pick up the material on the face of the model, and I apply it on the face inside the the group.
Its work great, the texture mapping of the face inside the group is exactly the same than the face of the model.

I try to do the same with a group with a different transformation than the model ( axe and origin).
To do that I apply the transformation of the group on the projected texture. but it fail. The texture didn’t match to the face of the model.

Find below the code

ortho_material = face_of_the_model.first.material
face_inside_the_group.material = material
t0 = face_inside_the_group.parent.instances.first.transformation
vector = Geom::Vector3d.new 0,0,1
vector.transform! t0
face_inside_the_group.set_texture_projection(vector.to_a, true)

A antoher point that make me crazy. The texture of the group, change when I enter inside it, as the giff show it.
Theyre no texture on the group only on the face inside.

texture change

Thanks for your help

I think set_texture_projection might not be working as it should.

Can you post sample model as well?

1 Like

Please find enclosed the model

(too large to be enclosed into the post)

https://drive.google.com/file/d/0B11z0ao7z1pRLS1hZWRLMW1HVmc/view?usp=sharing

Looking at the code, set_texture_projection isn’t much use. It only set a projection direction, but lacks ability to set position. Logged an issue internally as SU-37631.

1 Like

Thanks !!!

Envoyé de mon iPhone

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.