Hi Enrico,

On Thu, 2004-03-25 at 03:22, Enrico Borrione wrote:
> hi dirk,
> thx for the NegZ hint, i was finally able to load all the six faces... 
> I also swapped to makeLatLongSphereGeo primitive. Now the problem is
> that my sphere isn't cubemapped... My application just wraps around the
> sphere one of the faces (the negx one). Here is my code, is there
> anything wrong?
> 
> ////////////////////////////////////////////////////////
> ///  diffuse map generation - fasten your seatbelts  ///
> ///  **********************************************  ///
> void DiffuseMapBilder()
> {
>     CubeTextureChunkPtr cubemap;
>     cubemap=CubeTextureChunk::create();
>     
>     ImagePtr immagine;
>     immagine=Image::create();
>     
>     UInt8 skydataposx[256*256*3];
>     LoadImg("0.bmp",skydataposx);
>     immagine->set (Image::OSG_RGB_PF,256,256, 1, 1, 1, 0, skydataposx);
>     cubemap->setPosXImage(immagine) ;
>     
>     UInt8 skydatanegx[256*256*3];
>     LoadImg("1.bmp",skydatanegx);
>     immagine->set (Image::OSG_RGB_PF,256,256, 1, 1, 1, 0, skydatanegx);
>     cubemap->setNegXImage(immagine) ;
> 
>     UInt8 skydataposy[256*256*3];
>     LoadImg("2.bmp",skydataposy);
>     immagine->set (Image::OSG_RGB_PF,256,256, 1, 1, 1, 0, skydataposy);
>     cubemap->setPosYImage(immagine) ;
> 
>     UInt8 skydatanegy[256*256*3];
>     LoadImg("3.bmp",skydatanegy);
>     immagine->set (Image::OSG_RGB_PF,256,256, 1, 1, 1, 0, skydatanegy);
>     cubemap->setNegYImage(immagine) ;
> 
>     UInt8 skydataposz[256*256*3];
>     LoadImg("4.bmp",skydataposz);
>     immagine->set (Image::OSG_RGB_PF,256,256, 1, 1, 1, 0, skydataposz);
>     cubemap->setPosZImage(immagine) ;
> 
>     UInt8 skydatanegz[256*256*3];
>     LoadImg("5.bmp",skydatanegz);
>     immagine->set (Image::OSG_RGB_PF,256,256, 1, 1, 1, 0, skydatanegz);
>     cubemap->setImage(immagine) ;
> 
>     cubemap->setMagFilter(GL_NEAREST);
>     cubemap->setMinFilter(GL_NEAREST);
> 
>     diffCubeMap->addChunk(cubemap);
>     
>     // DISCONNECTED PROGRAMS
>     //diffCubeMap->addChunk(vp);
>     //diffCubeMap->addChunk(fp);
>              
>     MaterialGroupPtr grp = MaterialGroup::create();
>         
>     grp->setMaterial(diffCubeMap);
>     MaterialPtr mat=NullFC;
>     mat=grp->getMaterial();
> 
>     beginEditCP(geosfera, Geometry::MaterialFieldMask );
> 
>     geosfera->setMaterial(mat);
>     endEditCP(geosfera, Geometry::MaterialFieldMask );
>     printf("Farewell and thank you for the fish\n");
> }
> 
> now why when i try to display my sphere i find it wrapped just into the
> NegXImage? Do i have to set up any of the env parameters? 

You're only using one Image. That way the second image replaces the
first one and so on. You need a separate Image for each texture you
load, as the Image holds the actual data, the TextureChunk just uses it.
The reason is to allow you to use one Image in several TextureChunks,
with different parameters.

> second quastion: as u can see my app has 2 disconnected handles to v/f
> programs. Even if i uncomment em nothing changes. I am pretty sure that
> the loading part is correct, since no error message is prompted. Any
> clues?

If the loading doesn't print any warnings, I can only imagine that your
drivers don't support VP and FP. Could you try setting OSG_LOG_LEVEL to
debug and send me the output (compressed, preferably ;).

Thanks

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to