zonk wrote: > > the triangle mesh of the terrain will represent the resolution of the DEM, > not of the texture. Usualy texture resolution is higher than the DEM ones, > therefore you would reduce your image resolution if you don't use textures > but try to assign each vertex a color. > > But nevertheless you can access the color in the texture: > Perform an intersection and you will get the vertex indices of the primitive > you intersect. Additionally you'll get the ratio of the intersection between > the vertices, then you can interpolate the coordinates of the 3 vertices and > you have the texture coordiante you need to lookup the color in the texture. >
Thanks for the advice. To clarify, my two geotiff files that I am feeding into osgdem both have the same pixel resolution. I used gdal_translate to convert dted data into one geotiff, and used gdal_translate to convert a 16-bit floating point raster file with actual temperatures into a geotiff that has had those temperatures scaled to 0-255. I couldn't get osgdem to handle the original 16-bit raster file that hadn't had the temperatures scaled to 0-255. The plan was to encode the temperatures in the rgb values in a geotiff, use osgdem to create the osg file, read that osg file into my osg program, then decode the rgb values in the osg file so that I could perform data analysis on the temperatures. I also need to be able to change the colors of the primitives in the osg terrain after performing calculations on the temperatures. This is what prompted my original question asking about how I could access the temperatures at each primitive; I wanted to use a node visitor, grab the rgb values from e ach, do some math, then recolor the primitive. I know it's a convoluted solution but it's all I could think to do with my limited osg skills. Is there an obvious alternative workflow that I'm missing besides doing what you say and finding intersections? I am trying to add as little computational overhead as possible in this process so that the node recoloring process won't take forever. Note: I use the --geocentric and --POLYGONAL flags with osgdem; I like the way it creates a geocentric database, and I need that aspect of it so that I can easily place objects on the terrain using lat lon values, which I'm already doing. Thanks again for your support. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43900#43900 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

