Repeating a texture over a plane in SceneKit

前端 未结 4 1132
眼角桃花
眼角桃花 2021-02-05 17:05

I have a 32x32 .png image that I want to repeat over a SCNPlane. The code I\'ve got (See below) results in the image being stretched to fit the size of the plane, rather than re

4条回答
  •  长发绾君心
    2021-02-05 17:28

    You can learn it from Scene kit viewer Suppose You have SCNplane in your scene kit

    Create scene file drag a plane

    Which size is 12 inches in meter it is 0.3048

    and select image in diffuse

    now You have image with 4 Grid as shown in image

    we want each box to be show in each inches so for 12 Inches we need 12 box * 12 box as we have 12 inches box

    to calculate it. First we need convert 0.3048 meter to inches

    which is meters / 0.0254 answer is 12.

    but we need each grid to show in each inch so we also need to divide 12 / 4 = 3

    now goto show material inspector and change scale value to 3

    you can see 12 boxes for 12 inch plane.

    Hope it is helpful

提交回复
热议问题