<?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: CCTV Viewshed in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346682#M4780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can only answer some general cga questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;i()&lt;/SPAN&gt; operation inserts an asset.&amp;nbsp; In this case, the asset is a .dae file, but the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;i()&lt;/SPAN&gt; operation accepts other types as well.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-i.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-i.htm"&gt;insert operation—CGA | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;@Hidden&lt;/SPAN&gt; is an annotation written before an attribute that makes that attribute not appear in the Inspector.&amp;nbsp; It does not affect the outcome of the code.&amp;nbsp; It only controls whether or not an attribute will appear in the Inspector.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-6B024D81-8C7C-4C00-A227-503B505182B5" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-6B024D81-8C7C-4C00-A227-503B505182B5"&gt;Annotations—CGA | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Apr 2020 12:56:31 GMT</pubDate>
    <dc:creator>CherylLau</dc:creator>
    <dc:date>2020-04-20T12:56:31Z</dc:date>
    <item>
      <title>CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346679#M4777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use Carl Besters CCTV code.&amp;nbsp; I have the cameras in CityEngine but when I run the cga&amp;nbsp;script the viewshed is rotated by 180 degrees.&amp;nbsp; So basically the narrow part is rotated around and the wide part is centered on the camera.&amp;nbsp; Anyone have any suggestions?&amp;nbsp; Code is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * File: CCTV2.cga&lt;BR /&gt; * Created: 8 October 2015 12:02:25 GMT&lt;BR /&gt; * Author: Carl Bester&lt;BR /&gt; */&lt;/P&gt;&lt;P&gt;version "2017.1"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt; #####################################&lt;BR /&gt; ##Attributes&lt;BR /&gt; &lt;BR /&gt; attr viewObject = "models/WebCamView.dae"&lt;BR /&gt; @Hidden&lt;BR /&gt; #The elevation of the camera&lt;BR /&gt; attr Elevation = 50&lt;BR /&gt; &lt;BR /&gt; #The maximum distance range of the camera&lt;BR /&gt; attr ViewLength = 150&lt;BR /&gt; &lt;BR /&gt; #The optical viewing angle of the camera&lt;BR /&gt; @Range(10,120)&lt;BR /&gt; attr CameraAngle = 90&lt;BR /&gt; &lt;BR /&gt; #Azimuth direction of the camera&lt;BR /&gt; @Range(0,359)&lt;BR /&gt; attr Direction = 0&lt;BR /&gt; &lt;BR /&gt; #The vertical viewing range of the furthest point (from bottom to top of the screen&lt;BR /&gt; attr VerticalHeight = 50&lt;BR /&gt; &lt;BR /&gt; #The Calculated width of the scene&lt;BR /&gt; @Hidden&lt;BR /&gt; attr Width = getWidth(ViewLength)&lt;BR /&gt; &lt;BR /&gt; #The vertical rotation of the camera view&lt;BR /&gt; @Range(0,90)&lt;BR /&gt; attr VerticalRotation = 20&lt;BR /&gt; &lt;BR /&gt; #The actual azimuth value used to rotate the view. Internal Attributes&lt;BR /&gt; @Range (0,360)&lt;BR /&gt; @Hidden&lt;BR /&gt; attr HorizontalRotation = getRealDirection(Direction)&lt;BR /&gt; &lt;BR /&gt; #####################################&lt;BR /&gt; ##Functions&lt;BR /&gt; &lt;BR /&gt; getWidth(x) = (tan(CameraAngle/2)*ViewLength)*2&lt;BR /&gt; getRealDirection(x) = -1 * (x + 180)&lt;BR /&gt; &lt;BR /&gt; #####################################&lt;BR /&gt; ##Rules&lt;BR /&gt; &lt;BR /&gt; @StartRule&lt;BR /&gt; &lt;BR /&gt; Lot--&amp;gt; Object&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; Object--&amp;gt; i(viewObject)&lt;BR /&gt; Rotate&lt;BR /&gt; &lt;BR /&gt; Rotate--&amp;gt; rotate(abs, world,VerticalRotation,HorizontalRotation,0) &lt;BR /&gt; Scale&lt;/P&gt;&lt;P&gt;Scale--&amp;gt; s(Width,VerticalHeight,ViewLength)&lt;BR /&gt; center(xy)&lt;BR /&gt; set (material.color.a ,0.5)&lt;BR /&gt; Yellow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#####################################&lt;BR /&gt;##Colors&lt;/P&gt;&lt;P&gt;Yellow--&amp;gt; color("#FFFF00")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:32:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346679#M4777</guid>
      <dc:creator>RichLeeson</dc:creator>
      <dc:date>2019-01-16T20:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346680#M4778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't tell what the problem is, but if your object should be rotated 180 degrees, then use the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;r()&lt;/SPAN&gt; operation to rotate it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm"&gt;https://doc.arcgis.com/en/cityengine/latest/cga/cga-r.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hint:&amp;nbsp; You can use the Model Hierarchy (Window -&amp;gt; Show Model Hierarchy -&amp;gt; Inspect Model -&amp;gt; click on shapes) to view the scope of your shapes at any point in the shape tree.&amp;nbsp; This will help you determine which axis you need to rotate around.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2019 15:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346680#M4778</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-05-09T15:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346681#M4779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #5e5e5e; background-color: #ffffff; border: 0px; font-size: 16px; margin: 0px 0px 1.6em; padding: 0px;"&gt;Thank you for responding to the above post. I realize it’s been a while since this topic was made, but I am currently attempting to use the same cga rules posted above for some camera visibility analysis. I am new to City Engine and its cga language / rules, and I have a couple of simple questions about the above cga ruleset.&lt;/P&gt;&lt;P style="color: #5e5e5e; background-color: #ffffff; border: 0px; font-size: 16px; margin: 0px 0px 1.6em; padding: 0px;"&gt;Is the“WebCamView.dae” file above, the “viewobject” file, a simple triangle or pyramid model?&amp;nbsp;Can I make this model by creating a pyramid-shaped&amp;nbsp;multipatch in ArcGIS Pro and then&amp;nbsp;do Multipatch to Collada geoprocessing?&amp;nbsp;How does the ruleset take into account the location of the camera locations, or how do I input camera locations into City Engine? Is each camera location its own model within the above collada file?&lt;/P&gt;&lt;P style="color: #5e5e5e; background-color: #ffffff; border: 0px; font-size: 16px; margin: 0px 0px 1.6em; padding: 0px;"&gt;&lt;SPAN&gt;Also, I don’t understand the section above for the “Object” rule (towards the bottom).&amp;nbsp;What does "i(ViewObject)" do to the attribute "viewobject"?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #5e5e5e; background-color: #ffffff; border: 0px; font-size: 16px; margin: 0px 0px 1.6em; padding: 0px;"&gt;&lt;SPAN&gt;Also, what does "@Hidden" mean?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #5e5e5e; background-color: #ffffff; border: 0px; font-size: 16px; margin: 0px 0px 1.6em; padding: 0px;"&gt;&lt;SPAN&gt;For the original poster, if I had to guess, I would attempt to find the problem by varying some of camera direction parameters. I find the "getrealdirection" function and the "Direction" attribute to be suspect for your case, based off of how the attribute HorizontalRotation is calculated in the ruleset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #5e5e5e; background-color: #ffffff; border: 0px; font-size: 16px; margin: 0px 0px 1.6em; padding: 0px;"&gt;Thank you,&lt;BR /&gt;Chris C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2020 14:01:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346681#M4779</guid>
      <dc:creator>ChristopherCook</dc:creator>
      <dc:date>2020-04-17T14:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346682#M4780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can only answer some general cga questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;i()&lt;/SPAN&gt; operation inserts an asset.&amp;nbsp; In this case, the asset is a .dae file, but the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;i()&lt;/SPAN&gt; operation accepts other types as well.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-i.htm" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-i.htm"&gt;insert operation—CGA | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;@Hidden&lt;/SPAN&gt; is an annotation written before an attribute that makes that attribute not appear in the Inspector.&amp;nbsp; It does not affect the outcome of the code.&amp;nbsp; It only controls whether or not an attribute will appear in the Inspector.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-6B024D81-8C7C-4C00-A227-503B505182B5" title="https://doc.arcgis.com/en/cityengine/latest/cga/cga-annotations.htm#GUID-6B024D81-8C7C-4C00-A227-503B505182B5"&gt;Annotations—CGA | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2020 12:56:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346682#M4780</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2020-04-20T12:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346683#M4781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the response, Cheryl. So the viewobject does start as a .dae file, and the i() operation is just a way to insert the shape at the right place within the rule. That makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anyone I might be able to contact regarding my questions above concerning how the "viewobject" file above is created?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Chris C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2020 13:39:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346683#M4781</guid>
      <dc:creator>ChristopherCook</dc:creator>
      <dc:date>2020-04-20T13:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346684#M4782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;I had been working on this and the was on another project, and now I'm just now getting back on this.&amp;nbsp; I still do not know CityEngine very well and have been asking the guy that did the original code lots of questions but just can't seem to get it to work.&amp;nbsp; I have the original model that I received from him that I can shoot you.&amp;nbsp; It'd be nice to have a fresh set of eyes take a look.&amp;nbsp; If you want the model just shoot me an e-mail at &lt;A href="mailto:richard.leeson87@gmail.com"&gt;richard.leeson87@gmail.com&lt;/A&gt;.&amp;nbsp; Also the original web page I found the original&amp;nbsp;this on is at&amp;nbsp;&lt;A href="http://urban-scene.blogspot.com/2016/01/cityengine-arcgis-pro-combine-to-show.html" target="_blank"&gt;http://urban-scene.blogspot.com/2016/01/cityengine-arcgis-pro-combine-to-show.html&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2020 15:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346684#M4782</guid>
      <dc:creator>RichLeeson</dc:creator>
      <dc:date>2020-04-27T15:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: CCTV Viewshed</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346685#M4783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone who stumbles across this post,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich L and I found that for the CCTV ruleset to work properly the initial model (.dae file) needed to be imported into CityEngine in a specific orientation. The Model Hierarchy window was useful for figuring out which initial orientation the model had to have for the CCTV ruleset to function properly. This rotation cannot be applied within the CCTV ruleset because of the manipulations to the model scale and direction&amp;nbsp;that occur within the ruleset. The way to get around this might be to build a model in a 3d modelling software, and create a unique model for each possible orientation of the model (six possible - like the faces of a square). Then attempt to apply each model within the CCTV ruleset and find the one that works properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2020 19:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/cctv-viewshed/m-p/346685#M4783</guid>
      <dc:creator>ChristopherCook</dc:creator>
      <dc:date>2020-05-19T19:31:19Z</dc:date>
    </item>
  </channel>
</rss>

