Results 1 to 4 of 4

Thread: texturing model by one picture stretched

  1. #1

    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/s...ow-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)
    Attached Images Attached Images
    Last edited by zak; 26-02-2012 at 12:32.

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: texturing model by one picture stretched

    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
    Attached Images Attached Images
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3

    Re: texturing model by one picture stretched

    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



  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: texturing model by one picture stretched

    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. It is very intuitive.
    I use both ThinEdge and Wings3D for most modeling.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. M15 texturing - UV Coordinates
    By dcromley in forum M15 file format
    Replies: 5
    Last Post: 06-04-2009, 08:41

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •