我应该如何在PHP中生成Minecraft皮肤的等轴测图像?

我应该如何在PHP中生成Minecraft皮肤的等轴测图像?

问题描述:

I'm trying to generate 3D isometric views of players' heads, but I'm not sure what kind of support PHP has for this type of operation, or of any external libraries that may be better suited.

Basically I need to take a net like this (here is a diagram showing what each portion is mapped to) and make a 3D head from it. I also need to include the 'head accessory' portions, which should be slightly larger/offset from the actual head.

Does anyone know how I should go about this?

我正在尝试生成玩家头部的3D等距视图,但我不确定是什么样的支持 PHP有这种类型的操作,或任何可能更适合的外部库。 p>

基本上我需要像这个 这里是显示每个部分映射到的内容的图表)并从中制作3D头部。 我还需要包括“头部附件”部分,它应该比实际头部略大/偏移。 p>

有谁知道我应该怎么做? p> \ n div>

Well first it will be a complex job in my view.

The http://www.minecraftwiki.net/images/0/01/Skinzones.png file you mentioned is flat, but you have to convert that in ISOMETRIC 3D look, so you have to distort the images

For example look at the images below

3D BoxBox Front SideBox Left Side

So you can see that 3D box image is created from the pieces of other images, the logic is to add perspective to the flat images and join them. but as it is 2D we will call it Image Distortion.

Unfortunately GD Library which comes bundled with PHP is not advanced enough to let you do such things.

You have to use some other library like Image Magic and this link is tutorial for using distort functions http://www.imagemagick.org/Usage/distorts/

Second big thing is the processing of the images, you can process the images live but it will consume lots of resources on server, so it is suggested that you use pre processed images, and not process them every time.

To generate the Isometric image you have to write the code your self, and it may need alteration on each image character depending upon the size of the image. But when you have written a code it will be easy.

My Suggestion is to write your own code once, then alter it for every character and save the processed images in a sprite and use them when you add play functionality.

check out this link as well

http://www.fmwconcepts.com/imagemagick/index.php