Therein
24-06-2009 12:36:13
Hello everybody! I'm new to PagedGeometry, and almost new to Ogre too, but I'm having a lot of fun in learning these powerful technologies, for which I must congratulate the people behind 
Well, the problem I'm having is this: I'm writing a cartographic application that represents vegetation layers using the GrassLoader, but obviously the size of the plants is affected by the terrain scale. This has lead me to the fact that, if I want to preserve the aspect of the layer independent from the scale, I must add a square scale factor to the density, so if the scale is very big the density is increased several times. So, while trying this, I got to an Exception which, after many hours of investigation, I came to the conclusion that must be related with the number of grass elements that can be contained in one single grass page.
I tried to reproduce it in the PagedGeometry Example 4 - GrassLoader, and I found that there is a limit to the density, either it is set in a layer, in the GrassLoader, or in a combination of them. I tried with different values, and the maximum values I could set for the layer density were these, depending on the page size parameter:
Well, the problem I'm having is this: I'm writing a cartographic application that represents vegetation layers using the GrassLoader, but obviously the size of the plants is affected by the terrain scale. This has lead me to the fact that, if I want to preserve the aspect of the layer independent from the scale, I must add a square scale factor to the density, so if the scale is very big the density is increased several times. So, while trying this, I got to an Exception which, after many hours of investigation, I came to the conclusion that must be related with the number of grass elements that can be contained in one single grass page.
I tried to reproduce it in the PagedGeometry Example 4 - GrassLoader, and I found that there is a limit to the density, either it is set in a layer, in the GrassLoader, or in a combination of them. I tried with different values, and the maximum values I could set for the layer density were these, depending on the page size parameter:
- size 120 --> density 4.50[/*:m]
- size 60 --> density 18.00[/*:m]
- size 240 --> density 1.377[/*:m]
- size 80 --> density 238[/*:m][/list:u]
So, this is how I concluded that the problem has to do with the number of grass elements per page, as there seems to be a relationship betwee the page area and the density, approximately represented by:
max_density = 64800 / (page_size)^2
The exception I get seems to be related with a memory leackage, or similar, it says:
Excepción no controlada en 0x00404d08 en Example 4 - GrassLoader.exe: 0xC0000005: Infracción de acceso al escribir en la ubicación 0x0548a000.
In english, more or less:
Unhandled exception in 0x00404d08 in Example 4 - GrassLoader.exe: 0xC0000005: Access violation writing in location 0x0548a000.
And I've found that it is thrown in grassloader.cpp, line 269.
So, is it a bug, or maybe the problem is with my computer or some sort of configuration? Has it happened to anyone else, or are you able to reproduce it?
Thank you very much in advance!