Re: [osg-users] Terrain by Heightmap

2009-07-27 Thread Robert Osfield
Hi Markus, osgTerrain does set CLAMP_TO_EDGE on all textures it generates, but in your code you don't even try to use osgTerrain's built in texturing, rather you go and create your own textures for some reason. The right way to do what you want is to simple create an ImageLayer with the

Re: [osg-users] Terrain by Heightmap

2009-07-26 Thread Robert Osfield
Hi Markus, On Sun, Jul 26, 2009 at 2:14 AM, Markus Husseinimar...@husseini.de wrote: @robertosfield: Can i use the Imagelayer to load the heigthmaptile form an heightmapimage too? Sorry I don't understand what you mean. An ImageLayer is an osg::Image Layer, you use it with an osg::Image...

Re: [osg-users] Terrain by Heightmap

2009-07-26 Thread Robert Osfield
Hi Markus, How did you create this model? What texturing if any are you applying? Is it one mesh? Its it many? You *really* have to provide more specific information about what you did to create this model, and also the hardware/OS you are using as all provide clues to what might be up as

Re: [osg-users] Terrain by Heightmap

2009-07-26 Thread Markus Husseini
@robertosfield: Itry to explain it but my English is not very well. The Terrain is loadet by many heightfields. The black lines u see are the borders form the singel heightfieldmeshes. Every Heightfield mesh has his own texture, because i dont know how i can load a textur to the whole Terrain.

Re: [osg-users] Terrain by Heightmap

2009-07-26 Thread Markus Husseini
So hi again. Now i tryed the osgTerrain Nodekit. To gernerate my Terrain. i greated 2 TerrianTiles. But now the whole Terrian is very dark. Look at the code pls and picture: Sorry but the code tag dont work right. osg::ref_ptrosgTerrain::Locator Locator1

Re: [osg-users] Terrain by Heightmap

2009-07-26 Thread Markus Husseini
Ok i fixed it i forgett to define a color layer. But the border ist also black between the Terraintiles. Please help [Image: http://www.husseini.de/markus/Terrain4.jpg ] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15453#15453

Re: [osg-users] Terrain by Heightmap

2009-07-26 Thread Gordon Tomlinson
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Markus Husseini Sent: Sunday, July 26, 2009 12:13 PM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Terrain by Heightmap Ok i fixed it i forgett to define a color layer. But the border ist also black between

Re: [osg-users] Terrain by Heightmap

2009-07-25 Thread Markus Husseini
@robertosfield: Can i use the Imagelayer to load the heigthmaptile form an heightmapimage too? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15445#15445 ___ osg-users mailing list

Re: [osg-users] Terrain by Heightmap

2009-07-24 Thread Markus Husseini
Ok now it works. Thanks a lot. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15327#15327 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Terrain by Heightmap

2009-07-24 Thread Robert Osfield
Hi Markus, The OSG has an osgTerrain NodeKit dedicated to the task of rendering terrain. All you need to do is create an osgTerrain::TerrainTile and assign your osg::HeightField to this as the elevation layer, and then assign an osgTerrain::GeometryTechnique to handle the actual rendering scene

Re: [osg-users] Terrain by Heightmap

2009-07-23 Thread Markus Husseini
Thanks a lot again for the answers. @Kim Bale: Your solution voice good. But i dont understand how i can get the pixel height infomation from an image obeject. Can You give me a example code, it would be very helpfull. If i have the Pixelinformation i can write my own Terrainclass too.

Re: [osg-users] Terrain by Heightmap

2009-07-23 Thread Kim Bale
osg::Image* img = osgDB::readImageFile(name); unsigned char pixel = img-data( x, y ); But as Pierre says, OSG offers a lot of support for rendering Height field data out of the box. It's worth digging around before reinventing the wheel as OSG has usually got there first. Regards, Kim.

Re: [osg-users] Terrain by Heightmap

2009-07-23 Thread Markus Husseini
Hi, i did this Code: osg::Image* img = osgDB::readImageFile(test.tga); osg::ref_ptrosg::HeightField heightmap = new osg::HeightField; for(int z=0; z256; z++) { for(int x=0; x256; x++) { heightmap-setHeight( x, z, img-data( x,z ) );

Re: [osg-users] Terrain by Heightmap

2009-07-23 Thread Kim Bale
Hi Markus, Take a look at the documentation online: http://blogninja.com/doc/openscenegraph-doc/openscenegraph/classosg_1_1HeightField.html http://blogninja.com/doc/openscenegraph-doc/openscenegraph/classosg_1_1HeightField.htmlShould answer your questions. OSG function names are in general

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread Markus Husseini
Hello, I want to create a Terrain form a heightmap picture. Does someone know a good tutorial or can explain me the steps to realize this problem with osg. I am sitting here the whole day and search for tutorials or something else but i cant find something. I would be happy for your help.

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread declic creation
Hi Markus Take a look at VirtualPlanetBuilder : http://www.openscenegraph.org/projects/VirtualPlanetBuilder Regards -- Christophe Loustaunau On Wed, Jul 22, 2009 at 9:33 PM, Markus Husseini mar...@husseini.de wrote: Hello, I want to create a Terrain form a heightmap picture. Does someone

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread Kim Bale
Or for a more hands on approach try: http://www.lighthouse3d.com/opengl/terrain/index.php3?heightmap http://www.lighthouse3d.com/opengl/terrain/index.php3?heightmapIt's a pure OGL example but it should be pretty simple to translate for use in OSG. Good luck. Kim. 2009/7/22 Markus Husseini

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread Markus Husseini
Thanks for the answers. @declic creation: I think this is a little bit to much for my project. @Kim Bale: This looks nice, but my problem is that i have to use the osg API only and there I need the opengl libs ;(. Or i must write my own Code to load an image and get there data. I read

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread Kim Bale
Hi Markus, Assuming you're using a simple grayscale image as your heightmap. A very quick way would be to use the osg::HeightField shape in conjunction with the osg::ShapeDrawable class. You would load the image into an osg::Image class and then extract the height information, in this case the

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread Pierre BOURDIN
2009/7/22 Markus Husseini mar...@husseini.de: Thanks for the answers. @declic creation: I think this is a little bit to much for my project. @Kim Bale: This looks nice, but my problem is that i have to use the osg API only and there I need the opengl libs ;(. Or i must write my own Code to

Re: [osg-users] Terrain by Heightmap

2009-07-22 Thread Pierre BOURDIN
2009/7/22 Pierre BOURDIN bour...@imerir.com: 2009/7/22 Markus Husseini mar...@husseini.de: Thanks for the answers. @declic creation: I think this is a little bit to much for my project. @Kim Bale: This looks nice, but my problem is that i have to use the osg API only and there I need the