<?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: Texture stretch in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308824#M4384</link>
    <description>&lt;P&gt;I had a look again. See the following comments on this situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's the PICTURE command.&lt;BR /&gt;This places a polygon with the referenced picture as face.&lt;BR /&gt;However this implicit polygon still has a material definition, as explained in the manual (under "miscellaneous").&lt;BR /&gt;The material and the texture will be combined together. This holds true for any inlined material, too!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. in my case I had a refelective material. In that case the emission RGB is the color which determines the look in the shaded views. But this color will also be set against the texture! If your emission e.g. is fully black, the texture won't be visible at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is the PIPG command as a combination of PICTURE and PGON. This one is just mysterious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is VERT and TEVE. Verts are integrated into COOR{3}, but to me this doesn't seem to make any difference, as this is only the definition of the coordinate system but can't warp or stretch textures – as stated above. TEVE on the other hand might be able to do this, but I haven't tested it. The manual states it would only make any difference in the photorealistic view (rendering). That would defy my purpose because I want to have the texture stretched in BimX and the OpenGL viewport.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end I just looked in the wrong place:&lt;BR /&gt;Instead of stretching the texture in the &lt;EM&gt;material definition&lt;/EM&gt; you do it in the &lt;EM&gt;texture definition&lt;/EM&gt;.&lt;BR /&gt;So you'll need to be sure your texture image is in the loaded library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See example code:&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;define texture "mytexture" "texture.png", A, B, 128+256, 0

define material "mymat" 20, !/* type (n ⇒ 19) */
   0.8, 0.8, 0,             !/* surface RGB [0.0 .. 1.0] */
   0.0, 0.0, 0, 0,          !/* ambient, diffuse, specular, transparent
      ! coefficients [0.0 .. 1.0] */
   100,           !/* shining [0.0 .. 100.0] */
   0,             !/* transparency attenuation [0.0 .. 4.0] */
   0.8, 0.8, 0.8, !/* specular RGB [0.0 .. 1.0] */
   1, 1, 1,       !/* emission RGB [0.0 .. 1.0] */
   0,             !/* emission attenuation [0.0 .. 65.5] */
   ind(FILL, "Empty Fill"), !/* hatch */
   0,             !/* special value `0` ⇒ use current pen for vectorial hatch */
   ind(TEXTURE, "mytexture")

set material "mymattest"

_idm = ind(MATERIAL, "mymat")  !/* the `ind` will resolve to `-1` */

cprism_{4} "mymat", "mymat", "mymat",
   0,
   4, 1,
   0, 0, 0, 15, _idm,
   1, 0, 0, 15, _idm,
   1, 1, 0, 15, _idm,
   0, 0, 0, -1, _idm

!/* Even tho cprism_{4} works with inline materials,
!   the material for the sides still has to be delivered
!   as an index (integer); you can't use strings there. */&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Oct 2021 21:43:59 GMT</pubDate>
    <dc:creator>runxel</dc:creator>
    <dc:date>2021-10-10T21:43:59Z</dc:date>
    <item>
      <title>Texture stretch</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308637#M4380</link>
      <description>&lt;P&gt;Can I somehow stretch a texture (be it inline or project based)?&lt;/P&gt;
&lt;P&gt;I can set the origin with COOR{3} – but I can't figure out how to stretch a texture to be a certain size.&lt;/P&gt;
&lt;P&gt;The vectors seem to be realigned to be unit vectors, so their length don't contribute anything.&lt;/P&gt;
&lt;P&gt;Am I missing something, or is it just not possible? (At least with Nurbs it is doable, afaik)&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 09:14:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308637#M4380</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2024-09-09T09:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Texture stretch</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308704#M4381</link>
      <description>&lt;P&gt;The streching should be defined in the material def.&lt;/P&gt;&lt;P&gt;Piotr&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 12:08:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308704#M4381</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2021-10-08T12:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Texture stretch</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308722#M4382</link>
      <description>&lt;P&gt;That's what I feared!&lt;/P&gt;&lt;P&gt;And yeah, makes sense most of the time, no doubt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there are cases, where I want to have rather "symbolic" textures, to spice up the BimX model, which would otherwise look a bit bland.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 13:35:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308722#M4382</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2021-10-08T13:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Texture stretch</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308725#M4383</link>
      <description>&lt;P&gt;Make a material def parametrized...but it would work only for the inline materials&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 13:47:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308725#M4383</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2021-10-08T13:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Texture stretch</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308824#M4384</link>
      <description>&lt;P&gt;I had a look again. See the following comments on this situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's the PICTURE command.&lt;BR /&gt;This places a polygon with the referenced picture as face.&lt;BR /&gt;However this implicit polygon still has a material definition, as explained in the manual (under "miscellaneous").&lt;BR /&gt;The material and the texture will be combined together. This holds true for any inlined material, too!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. in my case I had a refelective material. In that case the emission RGB is the color which determines the look in the shaded views. But this color will also be set against the texture! If your emission e.g. is fully black, the texture won't be visible at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is the PIPG command as a combination of PICTURE and PGON. This one is just mysterious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is VERT and TEVE. Verts are integrated into COOR{3}, but to me this doesn't seem to make any difference, as this is only the definition of the coordinate system but can't warp or stretch textures – as stated above. TEVE on the other hand might be able to do this, but I haven't tested it. The manual states it would only make any difference in the photorealistic view (rendering). That would defy my purpose because I want to have the texture stretched in BimX and the OpenGL viewport.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end I just looked in the wrong place:&lt;BR /&gt;Instead of stretching the texture in the &lt;EM&gt;material definition&lt;/EM&gt; you do it in the &lt;EM&gt;texture definition&lt;/EM&gt;.&lt;BR /&gt;So you'll need to be sure your texture image is in the loaded library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See example code:&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;define texture "mytexture" "texture.png", A, B, 128+256, 0

define material "mymat" 20, !/* type (n ⇒ 19) */
   0.8, 0.8, 0,             !/* surface RGB [0.0 .. 1.0] */
   0.0, 0.0, 0, 0,          !/* ambient, diffuse, specular, transparent
      ! coefficients [0.0 .. 1.0] */
   100,           !/* shining [0.0 .. 100.0] */
   0,             !/* transparency attenuation [0.0 .. 4.0] */
   0.8, 0.8, 0.8, !/* specular RGB [0.0 .. 1.0] */
   1, 1, 1,       !/* emission RGB [0.0 .. 1.0] */
   0,             !/* emission attenuation [0.0 .. 65.5] */
   ind(FILL, "Empty Fill"), !/* hatch */
   0,             !/* special value `0` ⇒ use current pen for vectorial hatch */
   ind(TEXTURE, "mytexture")

set material "mymattest"

_idm = ind(MATERIAL, "mymat")  !/* the `ind` will resolve to `-1` */

cprism_{4} "mymat", "mymat", "mymat",
   0,
   4, 1,
   0, 0, 0, 15, _idm,
   1, 0, 0, 15, _idm,
   1, 1, 0, 15, _idm,
   0, 0, 0, -1, _idm

!/* Even tho cprism_{4} works with inline materials,
!   the material for the sides still has to be delivered
!   as an index (integer); you can't use strings there. */&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Oct 2021 21:43:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/308824#M4384</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2021-10-10T21:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Texture stretch</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/309081#M4385</link>
      <description>&lt;P&gt;I was thinking about just that...(I was told already that my words sometimes are too "short" in describing something)&lt;/P&gt;&lt;P&gt;Piotr&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 15:15:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Texture-stretch/m-p/309081#M4385</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2021-10-12T15:15:02Z</dc:date>
    </item>
  </channel>
</rss>

