Jump to content

[SOLVED] setTexCoord0 not working


photo

Recommended Posts

Hello,

I am trying to update UV texture coordinates for a ObjectMeshStatic for each vertex in runtime.

Here is my code for now :

const auto value = ...;
const int num_vertices = mesh->getNumVertex(0);
for (int i = 0; i < num_vertices; i++)
{
    auto tex = mesh->getTexCoord0(i,0);
    tex.y = value;
    mesh->setTexCoord0(i, tex, 0);
}

setTextCoord0 seems to have no effect visually on the mesh.

Is there anything I am doing wrong?

Is there anyway I can use a UV transform which corresponds to the mesh and not the material?

Thanks

Link to comment

If you need to update coordinates in runtime you can try to use ObjectMeshDynamic instead.

You can also use expressions for the UV transforms in runtime. For example, in order to simulate some simple animations (like texture sliding across the mesh or scaling):

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Multiple meshes (with the same material) can have different UV transforms. I think the solution is to use a ObjectMeshDynamic instead.

I will try this and get back to you to keep you up to date :) Thanks.

Link to comment
  • silent changed the title to [SOLVED] setTexCoord0 not working
×
×
  • Create New...