Posts

[051] Understanding the Concept of Scope in CityEngine CGA

Image
This tutorial breaks down the fundamental logic of the 'Scope' in Esri CityEngine CGA. We explore its core characteristics as a virtual bounding box, explain why rotation is necessary for non-orthogonal designs, and introduce the specific alignment commands needed to snap coordinate systems to geometry. There is still more work to be done, but I’ve found some breathing room during the review phase. Starting today, we will cover the "Scope," a concept I have consistently mentioned while discussing CityEngine’s CGA programming. For users coming from traditional 3D modeling, Scope is often the first major obstacle when learning CityEngine CGA. In CityEngine, it is virtually impossible to create various forms without understanding the Scope. It is also quite difficult to find places to learn this, even when searching for CityEngine-related courses, lectures, or tutorials. What Is Scope in CityEngine CGA? Th...

[049-050] Things to Know Before Writing CGA Code in CityEngine

Learn critical habits and troubleshooting workflows to improve your CGA coding efficiency in Esri CityEngine. This tutorial outlines essential best practices for CityEngine beginners, focusing on variable management through annotations, visual debugging techniques using component colors, and understanding the logic of geometric transformations and parameter passing. Every programming language has its own set of rules. As you learn and use these rules, you naturally become more efficient and experienced. Since it will be difficult for me to post long articles for a while, I would like to briefly talk about some CGA coding tips. Think of this as a short break between lessons and feel free to read through it casually. These are simple tips that will be helpful for those starting with CGA coding. 1st.  Make these part of your workflow. Always use annotations when declaring variables. · W...

[048] Understanding the rotate() Command in Esri CityEngine CGA

Image
Learn how to manipulate 3D geometry coordinates using the rotate() command and understand how rule execution order impacts procedural outcomes. This tutorial explores the rotate() command in CityEngine CGA, highlighting its similarities to translate() while warning of the complexities involved in 3D rotation. We discuss the importance of coordinate systems and provide a practical exercise to observe how swapping command orders changes model orientation. rotate() works in much the same way as translate(). There is not much to explain separately. img 1 : https://doc.arcgis.com/en/cityengine/latest/cga/cga-rotate.htm As you can see from the reference above, it functions just like translate(). However!! Why Rotation Can Be Difficult in CGA Unlike translation, rotation is quite difficult to grasp intuitively. This happens because when rotation, scale, and translation commands are combined, the transfor...

[047] Understanding the r() Command for 3D Rotation in Esri CityEngine CGA

Image
Rotate procedural 3D objects by defining specific rotation centers within the model scope. This tutorial covers the fundamentals of the r() command in CityEngine. You will learn the difference between rotating around the scope origin and the scope center, enabling more precise control over object orientation in your procedural workflows. We are gradually reaching the end of the basics. We will cover the r() command, which is used to rotate the model. img 1 : Syntax and parameters for the r() command Rotation Centers: scopeOrigin vs scopeCenter If we compare it with the t() command we learned previously, there is one identical usage and one newly added usage. The identical usage is rotating based on the scope axis direction. The new functionality allows you to choose whether the rotation is based on the scope origin or the scope center. The scope origin is the point where the scope's x, y, and z axes in...

[046] How to Use the s() Scale Command in CityEngine CGA

Image
Learn how to use the s() command for fixed and relative scaling, and understand how CGA handles model reproduction during transformations. This tutorial explains the s() command in CityEngine, covering fixed dimensions, relative scaling using the quote (') operator, and the fundamental concept of how instructions automatically copy models within the rule hierarchy. It is used for scaling the size of a model, and the usage is as follows. img 1 : https://doc.arcgis.com/en/cityengine/latest/cga/cga-s.htm It uses three variables and increases or decreases the size in the direction of each axis based on the scope origin. Absolute vs Relative Scaling The input values can be entered as simple numbers or numbers preceded by a single quote ( ' ). If you enter only a number, it creates the model at that specific size; if you use the ' operator, it becomes a value multiplied by the scope length of th...

[045] Understanding the translate() Command in CityEngine CGA

Image
Precisely control asset positioning by understanding absolute and relative movement across different coordinate systems. This tutorial explains the 4-parameter translate() command in CGA. We explore how "abs" and "rel" modes interact with World, Pivot, and Scope coordinate systems, accompanied by video demonstrations to visualize how 3D assets shift within the procedural environment. Syntax and Parameters of translate() Let's look at the reference. img 1 : CGA Translate Documentation Reference It uses a total of four parameters. mode determines whether to use absolute (abs) or relative (rel) coordinates. coordSystem determines the coordinate system (one of scope, object, world, or pivot coordinate systems). x, y, z define movement along the selected coordinate system. In rel mode, they represent movement distances. In abs mode, they represent positions relative to the ...

[044] Understanding Scope and Object Movement in CityEngine CGA

Image
Learn the concept of scope and use the t() command to translate procedural geometries along their specific scope axes. This tutorial introduces the fundamental difference between the t() and translate() commands in CityEngine. It provides a deep dive into the concept of the "Scope"—the invisible bounding box that controls procedural operations—and demonstrates how rotating the scope changes the direction of object movement in both 2D and 3D environments. Difference Between t() and translate() CGA has two commands related to position movement: one is t() and the other is translate(). Generally speaking, you might wonder why it is necessary to have two separate commands for moving positions. To explain the difference simply, t() moves based on a single reference point—the 'axis direction of the scope'—while translate() allows you to select one of several references (world, pivot, object, scope) and move ...