Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make a real Mini Game jigsaw puzzle with Matlab

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report