POST
|
As Matthias says.. Attributes of generated Shapes can recieve their input from a number of sources. These sources can be changed via the little black arrows next to the attribute values. Clicking the black arrow with a white square gives access to the Attribute Connection Editor. If you modify a value of an attribute manually the value in the Attribute Connection Editor is automatically customized to User-defined value so any thing a script/rule does is ignored. If you expected the script/rule to provide the values to the attribute then make sure its set to Rule-defined value. My assumption in the example was that your "BUILDING_H" attribute was being driven by some other kind of input, so I was demonstrating how to pass values around to other attributes and to functions as well as how to access them for example the extrude() cga. I have a question.. What drives your "BUILDING_H" attribute value (what provides its value)? For example: Is it connected to a map layer? Have you set it manually, making it a User-defined value?
... View more
03-26-2013
11:43 AM
|
0
|
0
|
1172
|
POST
|
I'm not sure how to solve this: In situations where I have a corner such as the image, I am finding I am getting odd skinny buildings. I can't have this for a number of game reasons, player getting stuck. I am trying to find a way to prevent this type of generation and have the lot more appropriately filled with a building. Any ideas? [ATTACH=CONFIG]22948[/ATTACH]
... View more
03-25-2013
01:05 PM
|
0
|
1
|
905
|
POST
|
Can you Detail the bug here so we know the exact issue? I believe I am see two different handed returns from the the convert function when pulling back coordinates from roads when compared to other shape geometry, would this be accurate?
... View more
03-25-2013
08:25 AM
|
0
|
0
|
724
|
POST
|
//Create some attributes to store data attr BUILDING_H = 0.0 attr HEIGHT = 0.0 MyRule--> //within a rule: set the Height attr to the value of BUILDING_H, //assuming BUILDING_H is mapped to a map layer set(HEIGHT, BUILDING_H) //use a value of an attr, in this case HEIGHT that was just set above extrude(world.y, HEIGHT) //attribute to store number of floors attr numberOfFloors=0 //numFloors is a Function, with the value BH passed to it //case statements work as if/elif/else statements, //else can be used to catch in this case a building height of 0, //since we only calculate if a building height is over 0, //if the building height is over 120(units) we divide by 4 instead of three.. if its over 0 but less than 120 we divide by 3 numFloors(BH) = case BH>120: floor(BH/4) case BH > 0: floor(BH/3) else: 0 MyRule --> //here we pass BUILDING_H to our Function numFloors //the value returned from the calculation is passed to the attribute numberOfFloors, //functions have funky syntax.. i know.. //attr numberOfFloors value can now be used elsewhere in the rule set (numberOfFloors, numFloors(BUILDING_H)) Does this help?
... View more
03-22-2013
11:42 AM
|
0
|
0
|
1172
|
POST
|
Esri CityEngine 2011.2 build 120125 (release, win32-64bit)?
... View more
03-21-2013
08:55 AM
|
0
|
0
|
724
|
POST
|
Hey I need a hand here, I have only been concerned about orientations around the y-axis for most situations till now. However now I am working with assets I have placed along roads. The roads are conformed to a heightmap. The result in our engine are orientations that are incorrect. Is there a way to get quaternions back for orientation? Or Could you tell me the handedness of the rotations being applied so i know if to correct orientation. The Euler Angle System being used. many thanks
... View more
03-20-2013
02:24 PM
|
0
|
6
|
1033
|
POST
|
How do I correct for this..? As the resultant behaviour leaves me with floating buildings in our game engine.
... View more
01-31-2013
09:27 AM
|
0
|
1
|
796
|
POST
|
This is something that you would do via the reporting mechanism. Then use python to process the reported data.
... View more
12-13-2012
02:46 PM
|
0
|
0
|
433
|
POST
|
The reporting mechanisms are your main access to data on a shape. You need to use cga to put the required information into those reports. You can put many types of data into reports depending on how you break your model down. Reports are attached to resulting shapes (the final generated shape) or shape leaf's as they are generated. The data that is in a report can be effectively collected at export using the script based exporter. From experience I would advise you use the uuid's that are available for most things, record those into the report as the main method of data association. Within the script based exporter you can create complex python data structures to store information extracted from those reports. The information can then be written out too, for example, xml or Jason. As python works with these quite nicely. You could then write a parser/reader script in Unity to parse the output xml report data and do the application functions I think you are aiming to do, for shader assignments and texture hookups etc.
... View more
12-10-2012
11:45 AM
|
0
|
0
|
667
|
POST
|
Thanks for the reply, some very useful approaches to bear in mind! I spent many cycles thinking about this one over the last couple of days. I seem to have a result in cga this morning, another alternative. 🙂 I decided that finding the highest vertices was probably not the best approach for the application I was trying to achieve. Finding the highest logical point for the proxy light to be placed was the goal. (read bottom up, its a maya mel'ism I struggle to shake )
attr aabbYMax=0
ProxyPointLight -->
/*
Insert a pointlight representation
- using scatter to a only place one asset on the surfaces that are at the top
*/
scatter(surface,1,gaussian, top, 0)
{
s(0,0,0)
i("assets/proxies/pointLight.obj")
color("#ff0000")
PointLight. // now this just needs to be reported
}
ProxyTopDetail -->
/*
ProxyTopDetail is a shape that produces a representation of a roof top detail model
such as a tv/radio mast geometry on the top of a building
*/
s(0,scaleValue*assetInfo(bldTopDtl,sy),0)
i(bldTopDtl)
TopDetail.
// work out the top value of the bounding box,
// could be used later if needed for culling.. if needed
// i have a random scale value, within a tolerance for these kind of details
set(aabbYMax, (scope.elevation + (scaleValue*assetInfo(bldTopDtl, sy))))
print ("aabbYMax: " + aabbYMax)
//split out only object.top facing faces
comp(f)
{
//use separated faces as one shape
object.top=
color("#ff0000")
alignScopeToAxes(y)
ProxyPointLight
}
... View more
11-28-2012
09:17 AM
|
0
|
0
|
864
|
POST
|
thanks for the reply, I'm actually looking for vertices in city engine building geometry rather than terrain.
... View more
11-27-2012
11:36 AM
|
0
|
0
|
864
|
POST
|
I struggling to figure out how to locate the vertex with the highest y coord within a model. I'm looking for it to place air traffic type warning lights. I would assume that I would look for a vertex that is at the same height as the current scope? any ideas?
... View more
11-27-2012
09:10 AM
|
0
|
5
|
1094
|
POST
|
Interesting topics you post ! As we are using CityEngine for a game world production I guess we are looking for slightly different ways of controlling the data to a typical city visualisation use age. Thus a lot of the questions are related to inserting and working with custom artist built component geometry, which maps directly into a game world via a python export pipeline that marries to our data formats. Inserting signs on the sides of buildings for example I choose a sign from a library of sign geometry, then I am having to insert a cube first and I use the coordinates of the position of the cube, via the reporting mechanism, for placements within our engine, then I insert the chosen geometry afterwards for representation in city engine. This is fine as we only place these streetside. Now in other cases I have other game elements that are required all over the buildings at random that must be placed in accessible locations, to do this I think I will follow the same logic but using your prior suggestion to determine intersections. I am thinking occlusions are my only real choice, but I know they have overhead. 🙂
... View more
11-26-2012
02:10 PM
|
0
|
0
|
566
|
POST
|
hmm.. I guess I am trying to use these functions with inserted geometry leafs. My rule chooses to insert a geometry model of a advertising sign onto a face on the side of a building. However I want to ensure that it is only inserted if it does not touch another building that may be adjacent. I gather from the link you provided you are suggesting to extrude the given face and do a test to see if this extrusion touches the adjacent building. If not then continue to insert a model?
... View more
11-21-2012
08:23 AM
|
0
|
0
|
566
|
POST
|
hmm.. These don't appear to work in the manner I understood from the manual. Could you point me to a practical example so that I can see how they work and how to apply them. Many thanks
... View more
11-19-2012
11:56 AM
|
0
|
5
|
667
|
Title | Kudos | Posted |
---|---|---|
1 | 07-25-2012 03:42 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|