Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Different Textures for dbMakeObjectCube()

Author
Message
Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 18th Dec 2005 22:30
Hi,

I have created a simple cube using dbMakeObjectCube(). Then I did load an image and applied it as a texture to the cube with dbTextureObject(). Works fine. The texture is applied to all 6 faces of the cube. How can I apply different textures to different cube faces?

I would like to create a rotating cube with 6 different images on each side. How could this be done...?

many thanks,
Gyoergy
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Dec 2005 21:34
One way would be to create 6 planes and attach them to each other as limbs. Then you can texture each limb separately.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 20th Dec 2005 11:12
A related way would be to use a simple 3d Modelling app and create a cube with textures and export it as x-file. This way, you just have to load the object and all is fine.
Of course, if you need to change the texture on the fly a lot or if you dont want to use external ressources, I would go for the planes too

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;
Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 20th Dec 2005 20:40
Hi,

thanks so far. I checked the SDK help for limbs. okay, there are limb commands but I have no idea how to create a cube out of six planes using limb commands...

Step 1: I would use makeplane to create 6 planes
Step 2: I texture 6 planes with different textures (okay)
Step 3: do some limb operations to tie the 6 planes together, but how?
Step 4: now I could use this limb/plane thing like any other object? could I rotate the x position and it would rotate all 6 ülanes?

I will try to do some limb research, unfortunately the sdk help is so sparse... many thanks for your comments,

gyoergy
Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 21st Dec 2005 22:42
Hi guys,

now I got it.

dbMakeObjectPlane( 1, 2, 2 );
dbYRotateObject( 1, 180 );

the plane is always created with the backside to the camera.

then the right face of the cube is created:

dbMakeObjectPlane( 5, 2, 2 );
dbYRotateObject( 5, 180 );
dbFixObjectPivot(5);


dbYRotateObject( 5, -90 );

dbPositionObject( 5, 1,0,-1 );

then I do attach it to limb 0 of object 1

dbGlueObjectToLimb ( 5, 1, 0 );

I can texture the face object 5 with an image e.g. 7

dbTextureObject( 5, 7 );


this has to be done for each face with different rotations and positions.

many thanks,
Gyoergy

p.s.

the documentation of the SDK has misspelled the command

dbMakeObjectPlain

it has to be

dbMakeObjectPlane

Login to post a reply

Server time is: 2024-05-06 23:06:32
Your offset time is: 2024-05-06 23:06:32