Texture map for a 2D grid

前端 未结 4 578
名媛妹妹
名媛妹妹 2021-02-06 15:56

I have a set of points [x,y]=meshgrid(1:N,1:M) defined on a regular 2D, N x M grid. I have another set of points [u,v] that are some defor

4条回答
  •  孤独总比滥情好
    2021-02-06 16:45

    Assuming x, y, u and v are of the same size (MxN 2D matrices) and the image/texture you wish to map is I of size MxNx3 (three color channels), then you might find scatter useful:

    figure;
    scatter( u(:), v(:), 30, reshape( I, [], 3 ), 's', 'filled' );
    

提交回复
热议问题