<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Random texture origin for FOR – TO – NEXT in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372308#M797</link>
    <description>&lt;P&gt;I know there is an answer marked as solution, but now that I dig deeper, the less clear this whole thing is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why the texture becomes randomly rotated if what I set is the origin of it. Maybe my question wasn't clear enough and I apologize for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's say I have some planks of a terrace deck created using BLOCK on a&amp;nbsp; FOR-TO-NEXT, now if I assign a texture to that object, there will be an obvious texture tiling, what I'm going after is that each of those planks have the texture origin displaced so the texture tiling is not visible.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This is how the object looks like if I just apply a texture on it (not pretty at all):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jc4d_0-1678096954880.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34884i9F52B841B3B7F9A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jc4d_0-1678096954880.png" alt="jc4d_0-1678096954880.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, what I'm going after is that each plank has its texture moved randomly in X,Y,Z coordinates but keeping the direction so they are not rotated.&lt;/P&gt;
&lt;P&gt;Juan.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 10:05:17 GMT</pubDate>
    <dc:creator>jc4d</dc:creator>
    <dc:date>2023-03-06T10:05:17Z</dc:date>
    <item>
      <title>Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371687#M788</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a simple block using FOR – TO – NEXT to duplicate it, is there a way to add a random texture origin to each duplicated so there is no visible texture repetitions?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jc4d_0-1677498832649.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34680iAEF57F142F530C78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jc4d_0-1677498832649.png" alt="jc4d_0-1677498832649.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juan.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 11:54:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371687#M788</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2023-02-27T11:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371698#M789</link>
      <description>&lt;P&gt;Have you tried using COOR{3} with the origos supplied by the RND() function?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 12:39:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371698#M789</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2023-02-27T12:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371702#M790</link>
      <description>&lt;P&gt;Somehow I have tried but I cannot wrap my head around it.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;20:
block RimaA, RimaB, B
COOR{3} 2,4,
RND(0),RND(0),RND(0),
2000,2000,2000,
2000,2000,2000,
2000,2000,2000
RETURN&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juan&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 13:10:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371702#M790</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2023-02-27T13:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371719#M791</link>
      <description>&lt;OL&gt;
&lt;LI&gt;RND(x) where &lt;EM&gt;x&lt;/EM&gt; must be grater than 0, because RND will supply a random number between 0 and x.&lt;/LI&gt;
&lt;LI&gt;COOR{3} wants a direction vector. The default vector matrix would be:&lt;BR /&gt;1, 0, 0,&lt;BR /&gt;0, 1, 0,&lt;BR /&gt;0, 0, 1&lt;BR /&gt;Dont't know what you're doing? Just leave it as is.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 27 Feb 2023 17:09:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371719#M791</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2023-02-27T17:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371721#M792</link>
      <description>&lt;P&gt;You can also use translation with the coor{3}&lt;/P&gt;
&lt;P&gt;So you can have it add a random distance each next.&amp;nbsp; That's how I have my wood siding accessory.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 19:09:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371721#M792</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2023-02-27T19:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371734#M793</link>
      <description>&lt;P&gt;The format for COOR is like this.&lt;/P&gt;
&lt;P&gt;This is what I use to adjust my tile surface in the x and y directions - not random but via a hotspot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	prism_ 5, hob_height,
		0,0,15,
		0,b,15,
		a,b,15,
		a,0,15,
		0,0,-1!,

VERT 0+tile_fill_origin_x,0+tile_fill_origin_y,0 !Origin
VERT 1+tile_fill_origin_x,0+tile_fill_origin_y,0 !X direction
VERT 0+tile_fill_origin_x,1+tile_fill_origin_y,0 !Y direction
VERT 0+tile_fill_origin_x,0+tile_fill_origin_y,1 !Z direction
COOR 2+256,1,2,3,4
body -1
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to swap out the 'tile_fill_origin_x' &amp;amp; 'tile_fill_origin_y' for your randomly generated co-ordinate values, and add in something for z axis if tat is important.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RND(0) will not work.&lt;/P&gt;
&lt;P&gt;You must specify an upper random number i.e. RND(10)&lt;/P&gt;
&lt;P&gt;That will give you a random number between 0 and 10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I never got around to actually sending this reply and I see others have beaten me to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think there is an issue with the RND generator in that it will always give you the same sequence of 'random' numbers if used in a for next loop.&lt;/P&gt;
&lt;P&gt;It does produce a 'random' number, but I think it is always the same 'random' number if you use the same seed (the number in brackets).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 01:35:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371734#M793</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-02-28T01:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371765#M794</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;I think there is an issue with the RND generator in that it will always give you the same sequence of 'random' numbers if used in a for next loop.&lt;/P&gt;
&lt;P&gt;It does produce a 'random' number, but I think it is always the same 'random' number if you use the same seed (the number in brackets).&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is intentional, so that successive frames in a fly-through are stable relative to eachother.&lt;/P&gt;
&lt;P&gt;The random sequence is different for each instance of the same library part.&lt;/P&gt;
&lt;P&gt;You can use something like this to get a random number 1...&lt;SPAN&gt;_rangemax, initialized with a seed that is set from a global variable which changes when you need changes in the sequence:&lt;/SPAN&gt;(SYMB_POS_X, GLOB_FRAME_NR, GLOB_ID):&lt;/P&gt;
&lt;DIV style="color: #3d3d3d; background-color: #fafafa; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 16px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;SPAN&gt;int&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;rnd&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_seed &lt;/SPAN&gt;&lt;SPAN&gt;%&lt;/SPAN&gt;&lt;SPAN&gt; _rangemax&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt; &lt;SPAN&gt;+&lt;/SPAN&gt; &lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 09:02:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371765#M794</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-02-28T09:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371786#M795</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-02-28 072346.png" style="width: 870px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34707iD4085C58E7F1EF76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-02-28 072346.png" alt="Screenshot 2023-02-28 072346.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-02-28 072454.png" style="width: 839px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34708iE57236A26B02265D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-02-28 072454.png" alt="Screenshot 2023-02-28 072454.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; not saying you guys are wrong but this confuses me as this is the outcome I get using rnd in my loop.&lt;/P&gt;
&lt;P&gt;Maybe I can't see it but even when close the planks do not seem to be the same random number&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 14:35:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371786#M795</guid>
      <dc:creator>SenecaDesignLLC</dc:creator>
      <dc:date>2023-02-28T14:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371891#M796</link>
      <description>&lt;P&gt;Interesting, but two comments:&lt;/P&gt;
&lt;P&gt;GLOB_ID is treated as string, so you can't do mathematical operations (modulo here) on it. So you can't set _seed to GLOB_ID.&lt;/P&gt;
&lt;P&gt;Also using rnd() inside a loop will yield different results. However changing the object will indeed not change the individual loop results.&lt;/P&gt;
&lt;P&gt;See this example code for the 2D script: "last" is a parameter. If you change it, you will see that the discrete results stay the same, only the overall number of course changes. E.g. if the first result is "9.3781" it will always be the same. But the second row is different random.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;for i=1 to last
	_r = rnd(10)
	text2 0, -i*0.6, _r
next i&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using SYMB_POS_X as a seed is brilliant tho. That works like a charm.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 16:17:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/371891#M796</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2023-03-01T16:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372308#M797</link>
      <description>&lt;P&gt;I know there is an answer marked as solution, but now that I dig deeper, the less clear this whole thing is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why the texture becomes randomly rotated if what I set is the origin of it. Maybe my question wasn't clear enough and I apologize for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's say I have some planks of a terrace deck created using BLOCK on a&amp;nbsp; FOR-TO-NEXT, now if I assign a texture to that object, there will be an obvious texture tiling, what I'm going after is that each of those planks have the texture origin displaced so the texture tiling is not visible.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This is how the object looks like if I just apply a texture on it (not pretty at all):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jc4d_0-1678096954880.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34884i9F52B841B3B7F9A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jc4d_0-1678096954880.png" alt="jc4d_0-1678096954880.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, what I'm going after is that each plank has its texture moved randomly in X,Y,Z coordinates but keeping the direction so they are not rotated.&lt;/P&gt;
&lt;P&gt;Juan.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 10:05:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372308#M797</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2023-03-06T10:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372371#M798</link>
      <description>&lt;P&gt;Is it rotated? It is a bit hard to see in your image as your texture size is significantly bigger than your board size...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lingwisyer_0-1678152593873.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34900i184748EFCC1BB361/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lingwisyer_0-1678152593873.png" alt="Lingwisyer_0-1678152593873.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lingwisyer_1-1678152857678.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34901iB48F1FB88E5BBA4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lingwisyer_1-1678152857678.png" alt="Lingwisyer_1-1678152857678.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VERT	0 + tile_fill_origin_x[iDis],	0 + tile_fill_origin_y[iDis],	0	!Origin
VERT	1 + tile_fill_origin_x[iDis],	0 + tile_fill_origin_y[iDis],	0	!X 
VERT	0 + tile_fill_origin_x[iDis],	1 + tile_fill_origin_y[iDis],	0	!Y 
VERT	0 + tile_fill_origin_x[iDis],	0 + tile_fill_origin_y[iDis],	1	!Z 
coor	2+1024,	-1,	-2,	-3,	-4 &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 01:35:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372371#M798</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-07T01:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372391#M799</link>
      <description>&lt;P&gt;Yes, in my case the texture doesn't "follow" the board size. But the texture is not rotated.&lt;/P&gt;
&lt;P&gt;Could it be that I'm approaching this whole thing in the wrong way? &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my surface:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jc4d_0-1678165951248.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34904i594C315CDD18D404/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jc4d_0-1678165951248.png" alt="jc4d_0-1678165951248.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3D script:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;N1= CEIL(A /(RimaA+RimaV))

FOR H=1 TO N1
GOSUB 20
ADDx RimaV + RimaA
NEXT H


DEL TOP
END

20:
block RimaA, RimaB, B
RETURN&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juan &lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 05:17:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372391#M799</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2023-03-07T05:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372395#M800</link>
      <description>&lt;P&gt;Try this ...&lt;/P&gt;
&lt;P&gt;Just use your surface material.&lt;/P&gt;
&lt;P&gt;I have only offset in the 'y' direction.&lt;/P&gt;
&lt;P&gt;And maybe turn the 'random origin' off in your surface material (mine is off).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;board_width = 0.100
board_gap = 0.010

N1= CEIL(A /(board_width+board_gap))

FOR H=1 TO N1
GOSUB 20
ADDx board_width + board_gap
NEXT H


DEL TOP
END

20:

MATERIAL "Timber_Pine - vertical"
block board_width, B, ZZYZX
texture_origin_y = RND(10)
GOSUB 100

RETURN


100: !!texture mapping

VERT 0,0+texture_origin_y,0 !Origin
VERT 1,0+texture_origin_y,0 !X direction
VERT 0,1+texture_origin_y,0 !Y direction
VERT 0,0+texture_origin_y,1 !Z direction
COOR 2+256,1,2,3,4
body -1

RETURN&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarryKelly_0-1678168757745.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34907iB696DE89D1493325/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BarryKelly_0-1678168757745.png" alt="BarryKelly_0-1678168757745.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 06:17:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372395#M800</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-03-07T06:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372400#M801</link>
      <description>&lt;P&gt;Mind you, if you texture is big enough you may not even need the VERT/COOR gosub.&lt;/P&gt;
&lt;P&gt;You can see here the repetition without VERT/COOR - not great but it is OK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarryKelly_1-1678169205875.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34908iEA37AA678FAC1454/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BarryKelly_1-1678169205875.png" alt="BarryKelly_1-1678169205875.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarryKelly_3-1678169391725.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/34910i9CE433ECFC38DC7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BarryKelly_3-1678169391725.png" alt="BarryKelly_3-1678169391725.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using the VERT/COOR gosub, you are really just using the first edge of the material.&lt;/P&gt;
&lt;P&gt;I guess you could add in a 'texture_origin_x' offset as well which I took out of my example.&lt;/P&gt;
&lt;P&gt;Your texture only needs to be one board width if you do use it, but a bigger texture is fine because you can use it for other situations as well as in sheeting rather than boards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 06:16:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372400#M801</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2023-03-07T06:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372401#M802</link>
      <description>&lt;P&gt;Thank you, now I started understanding the logic (somehow &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;) . Some things are more difficult than expected,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juan&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 06:20:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372401#M802</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2023-03-07T06:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372404#M803</link>
      <description>&lt;P&gt;In my case I'm using a texture that is meant for wood panels more than borads, so having an offset in x and in z it helped a lot to avoid any tiling in any direction.&lt;/P&gt;
&lt;P&gt;The reason for all this is that those boards are going to be used as inner ceilings in open spaces that can cover up to 15m by 15m, and if you count that each board is 5cm wide, you can image how does it looks if there is no texture offset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Juan&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 06:50:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372404#M803</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2023-03-07T06:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372406#M804</link>
      <description>&lt;P&gt;Hi Peter,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can the seed range be used to randomise a material?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MATERIAL mat_array[int(rnd(SYMB_POS_X % mat_count)) + 1]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was hoping to use it within a loop to randomly use between 1 and 5 random materials, but the RND does not change within the loop, only when the object is placed again...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:33:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/372406#M804</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-13T07:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/373117#M805</link>
      <description>&lt;P&gt;COOR{3} expects that the texture axis coordinates are expressed in the space before moving the origin (unlike XFORM).&lt;/P&gt;
&lt;P&gt;It is much simpler to let GDL do the transformations, and use the current coordinate system with COOR{3}:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;add dx, dy, dz
rotz da
coor{3} 2, 4,
	0,0,0,
	1,0,0,
	0,1,0,
	0,0,1
del 2
body -1&lt;/LI-CODE&gt;
&lt;P&gt;Don't forget body -1 when modeling objects in a loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 08:02:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/373117#M805</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-03-14T08:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/373336#M806</link>
      <description>&lt;P&gt;Sorry, my mistake, I oversimpified the example. What worked for me is:&lt;/P&gt;
&lt;DIV style="color: #3d3d3d; background-color: #fafafa; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 16px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;SPAN&gt;int&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;rnd&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_seed * _rangemax) &lt;/SPAN&gt;&lt;SPAN&gt;%&lt;/SPAN&gt;&lt;SPAN&gt; _rangemax&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;+&lt;/SPAN&gt; &lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Here seed should be a fractional number greater than one to always utilize the whole range.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 10:33:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/373336#M806</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2023-03-16T10:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Random texture origin for FOR – TO – NEXT</title>
      <link>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/373447#M807</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi Peter,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;MATERIAL mat_array[int(rnd(abs(SYMB_POS_X) * mat_count) % mat_count) + 1]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is giving me a static number per instance of the object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lingwisyer_0-1679016652286.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/35187iFDE1A16D11EDC82E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lingwisyer_0-1679016652286.png" alt="Lingwisyer_0-1679016652286.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 01:31:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Random-texture-origin-for-FOR-TO-NEXT/m-p/373447#M807</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-17T01:31:27Z</dc:date>
    </item>
  </channel>
</rss>

