View Full Version : texturing model by one picture stretched
hello
this is the first time i am exposed by chance to modelling after i tried the Petr example waterpatch.zip here "Height of ground, how to get this":
http://www.thinbasic.com/community/showthread.php?8150-Height-of-ground-how-to-get-this
it is like the flying magic carpet. i have downloaded thinEdge1006, and realy this is an amazing world.
okay my question is it possible to texture the carpet by one picture? i mean when i replaced the original bmp file with the attached bmp (and correcting the reference in M15 file to that bmp) it displayed the image as multiple images (Tiles), how can i display only this one image stretched to that carpet without tiling.
attached bluesky.png (convert it to bmp for the M15 file)
Petr Schreiber
11-09-2010, 17:22
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
hello Petr
it is like a plastic piece ,very impressive. indeed i bypassed every post and example contains something about modelling, i was thinking that this is a cryptic subject especialy when we look the current 3d modellers it is like an airplane boing 747 panel, until i saw your example waterpatch. also the fact that M15 and obj files are text files. so i have decided to look again slightly at the subject,
i like the feature in thinedge to save M15 as obj file to a dedicated ExportedFiles folder. indeed it display obj files (after converting it to M15 files using the obj2m15 utility) more accurate than the commercial "Alteros 3D" program .
for the new users the site: http://psch.thinbasic.com/tools.html have a lot of tools concerning modelling.
i will study some 3D tutorials and lessons also the examples available for thinbasic in the forum and here C:\thinBasic\SampleScripts\TBGL\m15Models.
it seems a vast world, and i will try it moderately
thank you and best wishes
Petr Schreiber
11-09-2010, 20:29
Thanks for the nice words,
the tool on the mentioned website, OBJ to M15, provides even more precision and it also automatically goes arround oddities some OBJ exporters do.
If you need easy but powerful modeler of other kind than ThinEdge, I recommend Wings3D (http://www.wings3d.com/). It is very intuitive.
I use both ThinEdge and Wings3D for most modeling.
Petr