After a lot of experimenting I think that the initial problem was that the HeightField does not have a TextureOffset & TextureScale property, these are only available via a MaterialLibrary.Material. So I changed the example Fxy demo app by adding a MaterialLibrary and then:
However this just produces a solid color which seems to be taken from a single pixel in the image, at least changing the textureoffset can result in other colors that are seen in the image. Also the heightfield now shows as 'flat' with no shading of the shape.
Can someone please tell me what I need to do to get the image onto the heightfield via the MaterialLibrary with positioning and shading as seen when just loading an image directly into the HeightField's Material.texture.Image?
Hi Pavel,
Thank you for the links to those examples, I think I should be able to figure it out from them.
I had searched all the demos installed with the main code but had not found the Examples folder on SourceForge, I have downloaded all of them now though!
David.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After a lot of experimenting I think that the initial problem was that the HeightField does not have a TextureOffset & TextureScale property, these are only available via a MaterialLibrary.Material. So I changed the example Fxy demo app by adding a MaterialLibrary and then:
However this just produces a solid color which seems to be taken from a single pixel in the image, at least changing the textureoffset can result in other colors that are seen in the image. Also the heightfield now shows as 'flat' with no shading of the shape.
Can someone please tell me what I need to do to get the image onto the heightfield via the MaterialLibrary with positioning and shading as seen when just loading an image directly into the HeightField's Material.texture.Image?
DaveW,
Well, how to use texture images on heightfileds look at https://sourceforge.net/p/glscene/code/HEAD/tree/branches/Examples/Games/AlitaOnHeightfield/ or https://sourceforge.net/p/glscene/code/HEAD/tree/branches/Examples/Geoscience/Grid2dTerrain/ .
Otherwise place GLS.Graph.pas in your project dir, include additional methods to the TGLHeightField class and apply screenshots before and after texture overlay. Use f4 key to get into the unit and debug one, examples in attachments.
Pavel
Hi Pavel,
Thank you for the links to those examples, I think I should be able to figure it out from them.
I had searched all the demos installed with the main code but had not found the Examples folder on SourceForge, I have downloaded all of them now though!
David.