flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > How do Scaling texture uv coordinats ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1850
Roman 24 Dec 2023, 20:22
In Blender I scaling uv rect.
Code:
uv1.xy = 0.590, 0.890  
uv2.xy = 0.590, 0.596  
uv3.xy = 0.853, 0.890

uv1.xy *=1.66667;
uv2.xy *=1.66667;
uv3.xy *=1.66667;

;I get
uv1.xy = 0.490, 0.989
uv2.xy = 0.490, 0.499
uv3.xy = 0.931, 0.989
    


What is formula ? How this calculated ?
Post 24 Dec 2023, 20:22
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1850
Roman 24 Dec 2023, 20:36
I found this, but not sure is this right variant ?
Code:
point scaling(point p,float sx,float sy) {
    point s;

    int c[1][3];
    int a[1][3]={p.x,p.y,1};
    int b[3][3]={sx,0,0,0,sy,0,0,0,1};

    multmat(a,b,c);//result in  с

    s.x=c[0][0];
    s.y=c[0][1];

    return s;
}    
Post 24 Dec 2023, 20:36
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 27 Dec 2023, 04:25
Второй вариант использует матрицы. Что именно не понятно? Scaling значит что-то либо увеличить либо уменьшить.
Post 27 Dec 2023, 04:25
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.