<?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: Creating 3D trees in City Engine? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140636#M1868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;working on it ..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Feb 2013 14:44:23 GMT</pubDate>
    <dc:creator>MatthiasBuehler1</dc:creator>
    <dc:date>2013-02-13T14:44:23Z</dc:date>
    <item>
      <title>Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140631#M1863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wondering if anyone could give me some hints about how to make those neat 3D trees that people have in their city engine models? I have tree points with Z values. I have looked online and through the help and don't see anything about how to make those into trees. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 18:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140631#M1863</guid>
      <dc:creator>AnnaRoyar</dc:creator>
      <dc:date>2013-01-24T18:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140632#M1864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You just need to insert an obj tree at the point. You can use the obj's supplied by CE or get some from sketchup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the point you just assign the LotTree startrule and generate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
tree_tex = fileRandom("assets/trees/alleyTree_*_v1.obj")

LotTree--&amp;gt; s(0,rand(8,12),0) center(xz) i(tree_tex) Tree.&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:45:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140632#M1864</guid>
      <dc:creator>JoanneO_Brien</dc:creator>
      <dc:date>2021-12-11T07:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140633#M1865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tested this code, it perfectly works but i want to do the same operation with an attribute : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a shape called "TREE" and an attribute called "HEIGHT". How can i generate tree of different height with the attribute of the tree?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Next, how can i adapt this code to link different representation like pine, palm with obj?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tree_tex = fileRandom("assets/trees/alleyTree_*_v1.obj")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LotTree--&amp;gt; s(0,rand(8,12),0) center(xz) i(tree_tex) Tree.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aurelien&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 13:15:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140633#M1865</guid>
      <dc:creator>amamalalalalal</dc:creator>
      <dc:date>2013-02-12T13:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140634#M1866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi ..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;written from my head .. please test the code, it may contain errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

attr HEIGHT = 0 # connect to GIS attr
@Range( "palm", "pine", "eucalyptus" )
attr TREETYPE = "palm"

getAssetPath =
&amp;nbsp;&amp;nbsp;&amp;nbsp; fileRandom ( "assets/trees/" + TREETYPE + "/*.obj" )

@StartRule
TREE --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; alignScopeToAxes(y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; s(0,HEIGHT,0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; i(getAssetPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp; center(xz)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Tree.

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:45:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140634#M1866</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-11T07:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140635#M1867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;wonderful, you are a master. it is a code very useful for generating trees from shape data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a listing of cga rule file? it will be interesting to create a topic with all the cga rule file which works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the code. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2013 14:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140635#M1867</guid>
      <dc:creator>amamalalalalal</dc:creator>
      <dc:date>2013-02-13T14:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140636#M1868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;working on it ..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2013 14:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140636#M1868</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-02-13T14:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140637#M1869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to create a natural greenspace code with LOD options. Low LOD option works but High LOD creates trees far away from the original shape. Can anyone help me find what is wrong with my code. Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[PHP]@Range ("high", "low")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;attr LOD = "high"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@StartRule&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lot--&amp;gt;&amp;nbsp; Forest&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Green&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Forest--&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; scatter(surface, 200, gaussian, left, '0.5) { Tree } &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;treetex_high =fileRandom("tree_eu/*.obj")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;treetex_low = fileRandom("alleyTree/alleyTree_*_v1.obj")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tree--&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case LOD == "high" :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; i(treetex_high) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; t(0,0.2,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; s(5,rand (5, 15),5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; else: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; i(treetex_low)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; t(0,0.2,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; s(10,rand (15, 25),8)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; color("#86ad6f")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Green--&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; set(material.opacity, 0.5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; t(0,0.2,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; color (0,1,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/PHP]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 10:09:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140637#M1869</guid>
      <dc:creator>gulhunduran</dc:creator>
      <dc:date>2013-07-16T10:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140638#M1870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;use center()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;first, usually, do the s(), then center(), then i(). use t() after the i() to fix any issues left.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;notes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s(0,0,0) uses the asset's original size.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;s(0,treeHeight,0) will scale your asset proportinally to the given size&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;after scatter(), use alignScopeToAxes(y) to align the scope vertically, to make the tree stand vertically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ok?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 19:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140638#M1870</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-07-16T19:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating 3D trees in City Engine?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140639#M1871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah it's OK! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 11:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-3d-trees-in-city-engine/m-p/140639#M1871</guid>
      <dc:creator>gulhunduran</dc:creator>
      <dc:date>2013-07-18T11:49:23Z</dc:date>
    </item>
  </channel>
</rss>

