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 / How do I apply a texture to an object?

Author
Message
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 13th Dec 2010 01:09
I have a simple texture I would like to apply to a cube. What commands are there for textures?

Always program as if the person maintaining your program is a psychopath that knows where you live
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Dec 2010 01:16
Syntax
void dbTextureObject ( int iObject, int iImage )
void dbTextureObject ( int iObject, int iStage, int iImage )

Have a look at the Dark GDK documentation that comes with the install.

Warning! May contain Nuts!
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 13th Dec 2010 01:47
This is my text code and it won't work, whats wrong?



It loads but the cubes not textured.

Always program as if the person maintaining your program is a psychopath that knows where you live
Manga Tiger Boy
15
Years of Service
User Offline
Joined: 24th Aug 2009
Location:
Posted: 13th Dec 2010 02:48
try placing the dbTextureObject in the While loop?

CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 13th Dec 2010 04:04
That never helped, it would only cause the game to go slower applying a texture each time it loops.

Always program as if the person maintaining your program is a psychopath that knows where you live
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 13th Dec 2010 04:15 Edited at: 13th Dec 2010 04:17
Quote: "dbMakeCamera(1);
dbPositionCamera(1,0,0,0);"


Remove those lines, camera 0 is automatically created.

Also, your path is incorrect, backslash is the escape character so you must use double backslash to write a backslash in a string, or a forward slash, i.e:

dbLoadImage("C:\\Users\\Brett\\Desktop\\LegoGreen.jpg",1);

or

dbLoadImage("C:/Users/Brett/Desktop/LegoGreen.jpg",1);

CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 13th Dec 2010 07:02
It works, thanks guys.


Always program as if the person maintaining your program is a psychopath that knows where you live

Login to post a reply

Server time is: 2024-11-19 16:25:41
Your offset time is: 2024-11-19 16:25:41