Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 05:30:00 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)help| the Cube's metheds are static Why ?
Pages: [1]
Print
Author Topic: help| the Cube's metheds are static Why ?  (Read 217 times)
jpunk
Just dropped in

Offline Offline

Posts: 1


View Profile
« on: 26. May 2011, 11:28:59 am »

well... i want make a Bump map on the cube object and its ask me to create Geometry.
well i tyred use createGeometry method for this but its ask me for a static method to use it.
so why is the Cube,Box methods are static ?
and how i can simply add Bumpmapping to my cube object ?   Roll Eyes

as you see...
Quote
The static method createGeometry(float, float, float, int, boolean, int) from the type Box should
 be accessed in a static way
from Eclipse
« Last Edit: 26. May 2011, 11:36:28 am by jpunk » Logged
hawkwind
Getting respectable
***
Offline Offline

Posts: 363



View Profile Email
« Reply #1 on: 02. June 2011, 09:17:05 pm »

IN the BumpmappingTest example in xithtk you see code like the following, which sets the bump mapping and bumpmap texture to use.  If this is not adequate I can paste some lower level code

Code:
Torus torus = new Torus( 2.0f, 0.375f, 48, 48, Geometry.COORDINATES | Geometry.NORMALS | Geometry.TEXTURE_COORDINATES, false, 2 );
        //torus.getAppearance().getMaterial( true );
       
        Texture tex = TextureLoader.getInstance().getTexture( "lena.dds", TextureFormat.RGB, Texture.MipmapMode.MULTI_LEVEL_MIPMAP );
        torus.getAppearance( true ).setTexture( tex );
       
        torus.setBumpMappingEnabled( true, "normalmap.bmp" );
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 03. June 2011, 10:36:44 am »

Just use the static method like a static method Wink. I suppose, you're using it like this.

Code:
Box myBox = ....;
myBox.createGeometry( ... );

Simply replace it by
Code:
Box myBox = ....;
Box.createGeometry( ... );

That's, how static methods are used.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic