Hi Zak,
of course it is possible!
I am surprised you did downloaded the old ThinEdge (but it made me happy), good news for you might be I got it to compile with latest PowerBASIC, so some additional tweaks are possible for future.
In some areas I still prefer to use it over other modelers.
The options are two:
- Tune the model in ThinEdge, by choosing Texture coords shift mode and stretch it as you wish
- Do this programatically, using extensive m15 functions arsenal
I will show here the second way.
What do we need?
Stretch image to whole water patch
What does it mean in 3D speak?
We need to reset the UV coordinates to go from 0,0 to 1,1
How can we do that?
Using TBGL_m15* functions.
We know the model is planar, so it has only X and Z coordinates changing.
We can get total number of vertices using TBGL_m15GetModelVertexcount.
We can read vertex position by TBGL_m15GetVertexXYZ.
We can set vertex UVs by TBGL_m15SetVertexTexXY.
So what's the plan?
- retrieve minimal/maximal X, Z of the model
- set new UV coordinates
The solution is in the attached script. Just have a look at Normalize_UVCoordinates routine.
Petr
Bookmarks