Get the App
SLTechnology News&Howtos  ›  Development  › 

How to make a real Mini Game jigsaw puzzle with Matlab

Shulou Source: shulou.com Published: 2022-06-01 11:51:40 10月01日 Update

This article mainly introduces how to use Matlab to make a real jigsaw puzzle Mini Game, the article introduces in great detail, has a certain reference value, interested friends must read it!

A brief introduction to the principle:

1 construct 0 image 1 matrix as the transparency of each puzzle, you can construct an irregularly shaped puzzle (the jigsaw function has an alphaData attribute that can be set)

JigsawMask=zeros (101 / 5101 / 5); jigsawMask (102 / 5101 / 404) = 1; [xMesh,yMesh] = meshgrid (1 / 10 / 10 / 5 / 5); dis1=sqrt ((xMesh-51). ^ 2 + (yMesh-253). ^ 2); dis2=sqrt (xMesh-505+50). ^ 2 + (yMesh-253). ^ 2); dis3=sqrt ((xMesh-253). ^ 2 + (yMesh-152). ^ 2); dis4=sqrt ((xMesh-253). ^ 2 + (yMesh-505+151). ^ 2); bool1=dis1

Tags: Mini Game production content attributes articles irregularities codes values locations interests functions principles pictures guys buddies shapes buttons files squares more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB Shulou Information Redmi Xiaomi