<?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: How to set center pivot an Object? in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503337#M6826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After inserting a model in cga using &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;i()&lt;/SPAN&gt;, you can rotate it around&amp;nbsp;it's scope's center using &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;r()&lt;/SPAN&gt;&amp;nbsp;and specifying the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;centerSelector&lt;/SPAN&gt; as &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;scopeCenter&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;r operation—CGA | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To rotate and scale, you could translate, rotate and scale about the origin, and then translate back.&amp;nbsp; Translate using relative offsets.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Lot --&amp;gt;
	i(asset, yUp, keepSizeAndPosition)
	Transform(assetInfo(asset,tx)/scope.sx, assetInfo(asset,tz)/scope.sz)
	
Transform(relOffset_x, relOffset_z) --&amp;gt;
	t('-relOffset_x, 0, '-relOffset_z)
	r(0, 90, 0)
	s('2, '1, '0.5)
	t('relOffset_x, 0, 'relOffset_z)
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 22:04:55 GMT</pubDate>
    <dc:creator>CherylLau</dc:creator>
    <dc:date>2021-12-11T22:04:55Z</dc:date>
    <item>
      <title>How to set center pivot an Object?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503333#M6822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;[ATTACH=CONFIG]33004[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lots of 3D software has a button like Center Pivot/Center Origin etc. (Maya, Blender, Studio Max..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have imported some ready 3D models from internet but sometimes, some object's center pivot is not set and center is so far from the object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any button or tool in CityEngine to set it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Güçlü&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 10:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503333#M6822</guid>
      <dc:creator>GucluSen</dc:creator>
      <dc:date>2014-04-10T10:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to set center pivot an Object?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503334#M6823</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 am not sure if you can apply this info to Models, (probably Lot Shapes, or shapes, you may convert (right click on the model --&amp;gt; convert to shapes and try then, but you might loose textures)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Start New Rule to apply&amp;nbsp; code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Synopsis &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setPivot(axisMapSelector, cornerIndex)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parameters &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;axisMapSelector (selstr)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Selector which defines the mapping of the old scope axes to the new pivot (and scope) axes. Supported values are: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xyz: Keeps the current orientation, i.e. in corner 0 (the origin, see visual guide below), the new x-axis will point along the old scope's x-axis, the new y-axis will point along the old scope's y-axis and the new z-axis will point along the old scope's z-axis. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yzx: In corner 0, the new x-axis will point along the old scope's z-axis, the new y-axis will point along the old scope's x-axis and the new z-axis will point along the old scope's x-axis. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;zxy: In corner 0, the new x-axis will point along the old scope's y-axis, the new y-axis will point along the old scope's z-axis and the new z-axis will point along the old scope's x-axis. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cornerIndex (float)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Integer value in [0, 7] to select one of the scope's corners to become the new pivot.p. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; The setPivot operation lets you re-position and re-orient the current shape's pivot. The new orientation will be based on the current shape'sscope axes, the axisMapSelector and the cornerIndex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The new pivot.p will lie at a selected corner (cornerIndex) of the current shape'sscope, and the pivot will be rotated such that all axes point inside the scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The new scope will have zero translation and rotation (relative to the pivot), and will stay at the same place (in world coordinates), but with different axes. The geometry is projected to the new scope (i.e. stays at the same place in world coordinates).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Visual Guide&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; The scope of the current shape prior to the setPivot() operation is depicted in the picture on the left. The numbers depict the cornerIndices. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; The pivots after setPivot(xyz, v) with v = the cornerIndex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note the orientation of the pivots: in corner 0, the axes are the same as the original scope axes; at all other corners, the direction of y is the same (or the negative) of the y axis of the original scope. The other axes are oriented such that they conicide with a scope axis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; The pivots after setPivot(yzx, v) with v = the cornerIndex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note the orientation of the pivots: in corner 0, the scope axes xyz are replaced by the axes yzx.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; The pivots after setPivot(zxy, v) with v = the cornerIndex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note the orientation of the pivots: in corner 0, the scope axes xyz are replaced by the axes zxy."&amp;nbsp;&amp;nbsp; &amp;lt;-----CityEngine Help&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or you can try to move the model to the origin point in Sketchup:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]33038[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lukasz&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 11:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503334#M6823</guid>
      <dc:creator>LukeCzar</dc:creator>
      <dc:date>2014-04-11T11:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to set center pivot an Object?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503335#M6824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your detailed answer Lukas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's very complicated, lots of programs set this one click. I've found "Pos_Center" = false / true selection in "Object Attributes".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is useful for some model but not all of them. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If we have imported some 3D Warehouse model or many models using other software, User can't set every model using other some programs individually. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CityEngine make it more easy way to do this. &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;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2014 05:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503335#M6824</guid>
      <dc:creator>GucluSen</dc:creator>
      <dc:date>2014-04-18T05:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to set center pivot an Object?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503336#M6825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Being relatively new to CityEngine, I'm coming across this problem myself. It seems really bizarre to me that there is no simple way to rotate or scale an imported model about it's center. As &lt;SPAN style="background-color: #ffffff;"&gt;Güçlü&amp;nbsp;&lt;/SPAN&gt;says - other 3D packages supply this functionality as standard. Is there no way to do this easily in CityEngine?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2019 13:08:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503336#M6825</guid>
      <dc:creator>JackCurran</dc:creator>
      <dc:date>2019-09-07T13:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to set center pivot an Object?</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503337#M6826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After inserting a model in cga using &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;i()&lt;/SPAN&gt;, you can rotate it around&amp;nbsp;it's scope's center using &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;r()&lt;/SPAN&gt;&amp;nbsp;and specifying the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;centerSelector&lt;/SPAN&gt; as &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;scopeCenter&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;r operation—CGA | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To rotate and scale, you could translate, rotate and scale about the origin, and then translate back.&amp;nbsp; Translate using relative offsets.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Lot --&amp;gt;
	i(asset, yUp, keepSizeAndPosition)
	Transform(assetInfo(asset,tx)/scope.sx, assetInfo(asset,tz)/scope.sz)
	
Transform(relOffset_x, relOffset_z) --&amp;gt;
	t('-relOffset_x, 0, '-relOffset_z)
	r(0, 90, 0)
	s('2, '1, '0.5)
	t('relOffset_x, 0, 'relOffset_z)
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:04:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/how-to-set-center-pivot-an-object/m-p/503337#M6826</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2021-12-11T22:04:55Z</dc:date>
    </item>
  </channel>
</rss>

