Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11855 Posts in 1569 Topics- by 3058 Members - Latest Member: xynewhand

12. February 2012, 02:59:53 AM
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Inconsistant code in Appearance class ?????
Pages: [1]
Print
Author Topic: Inconsistant code in Appearance class ?????  (Read 290 times)
elijah
Enjoying the stay
*
Offline Offline

Posts: 72


View Profile
« on: 24. July 2010, 01:29:12 AM »

As I was going through the xith-tk examples I found some possible inconsistant code. What is the difference between setTexture and setTextureUnit when  Huh setTexture also create a TextureUnit for the given texture. In the xith-tk example TextureCoord3DTest when I tried to replace the code

        a.setTexture( waypointImage );
       
        with

        TextureUnit tu0 = new TextureUnit( waypointImage );
        a.setTextureUnit( 0, tu0);

The results are totally different. The 3 different texture does not rotate ? Can somebody explain this to me ?

Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #1 on: 24. July 2010, 08:35:40 AM »

That's strange. Could you please verify the Appearnce code setTexture()? It should be a convenience method for setTextureUnit() and shouldn't make a difference. Maybe I missed something.

Marvin
Logged
elijah
Enjoying the stay
*
Offline Offline

Posts: 72


View Profile
« Reply #2 on: 28. July 2010, 02:58:56 PM »

I have tried may times and came to the conclusion that they are different. You can try by just simply replacing
        a.setTexture( waypointImage );
       
        with

        TextureUnit tu0 = new TextureUnit( waypointImage );
        a.setTextureUnit( 0, tu0);

and compile the xith-tk. The results are very different. The setTextureUnit calls other function and has additional code but I do not understand the code. But the rule I used is when I want Texture3D I used a.setTexture but for Texture2D I used setTextureUnit.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic