I am working on an entire city (lots of buildings, streets, DEM, parks etc.) with quite a bit of detail.
So obviously my computer starts failing when I apply the rules to more than a few 'Lots'.
Getting more RAM is not really a solution (considering the size of the city).
So I was wondering if there is a way of dynamically displaying the objects.
At the moment I have defined 2 LODs in my rule. It would be perfect if the LOD
would dynamically change depending on the zoom (how close to the building)
and also on the perspective (which buildings I see right now).
So I only give detail to what I see and when I am close to it.
This is not a built in feature, so one possible solution is to use python. Pseudo-code:
1. Get location and direction of the current camera.
2. From that, determine which objects fall in viewshed.
3. Set an object attribute on each object falling in the viewshed, telling which LOD to use.
4. Regenerate all items in the viewshed.
Only issue is #2, since I can't say off top of my head how to find if object is in the view or not. So if we can't figure that out, then you can easily determine all objects that fall in a radius from the camera, but then you have items behind the camera that would be at an unnecessarily high LOD.
Is python an option for you?
What if RAM is a solution to this problem?...
I saw a presentation where Paris was generated in CityEngine and the movement was without lag. What specification do you think would be enough for rendering and generating an entire city without this kind of problems?
That sounds great, I have only started playing with CE for a few weeks but
I'm sure I will continue to run into issues that this thread will help with.
As a side note: is there a place where we can post .cga files and entire
projects? When I started I could not find such a place,
and it would have been very useful (it's much easier to modify something
than to start from scratch). And now I can post some of my work.
2014-11-05 17:36 GMT+02:00 Chris Wilkins <firstname.lastname@example.org>:
reply from Chris Wilkins
in CityEngine - View the full discussion
Yes, python is an option for me. I have not worked too much with it and certainly not in CE, but I can learn:)
Could you please point me to some resources. I have no idea where to start:
like where to get the location and direction of the current camera, where can I look, etc.
Thanks for the help.
I work with Chris.
In terms of CE python specific resources here is a good link.
While this is in the table of contents, functions related to camera angles/location/and other attributes are found here:
The python section on attributes is here:
From the look of it you will want setAttribute or some of other python attribute setting.
I hope some of this is helpful.