Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
changing colours or changing texture of floor and walls.
Topic Started: Nov 24 2010, 06:47 PM (585 Views)
joihnsonlee
Advanced Member
[ *  *  * ]
please anyone tell me how to change colour and texture of the floor, walls and ceiling.

using the execute script.
Offline Profile Quote Post Goto Top
 
112 in actie
Member Avatar
Member
[ *  * ]
With the following function you can change the color of the model (call after the model is created):
Code:
 
SetMaterial( Red, Green, Blue, Alpha )

With the variabele texture you can asign a preloaded texture to a object, in that case you have the following code:
Code:
 
LoadTexture( texture, textureID)
texture=1
// model creation functions


You can also look in the help file of U3D, it's very useful!
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
112 in actie
Nov 24 2010, 07:59 PM
With the following function you can change the color of the model (call after the model is created):
Code:
 
SetMaterial( Red, Green, Blue, Alpha )

With the variabele texture you can asign a preloaded texture to a object, in that case you have the following code:
Code:
 
LoadTexture( texture, textureID)
texture=1
// model creation functions


You can also look in the help file of U3D, it's very useful!
SetMaterial() is used for primitives like U3D's floors, walls and cubes.
To change the material of a model you need to use SetModelMaterial(materialID,r,g,b,a).
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]
can anyone explain what is texture id to me?

i read the documentation and i didn't get it.

and must u have a texture id in order to change the texture of the floor (instead of the grey default floor)
Edited by joihnsonlee, Nov 24 2010, 09:09 PM.
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
look at the example i made for you, see the LoadTexture(..) thing in the control object? there should be a number there that is the texture id or material id.

and yes if u want to change it, u must have a texture.
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]
how do u make a texture id?

if it's premade how do i know what is the texture id for a texture is?

Edited by joihnsonlee, Nov 24 2010, 09:22 PM.
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
All you have to is use LoadTexture("texturefile.jpg", 1);
see 1?
That is the id of the texture!!!

now you can refer to it for any primitive such as a floor,

in the floor create event there should be a variable called texture change it from -1 to 1 and viola
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]

i did that (making the texture id "1")and it changes the gun with the floor texture!!

instead of making the floor texture on the floor and u can't see the gun.

what i am doing wrong?
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
joihnsonlee
Nov 24 2010, 09:51 PM
i did that (making the texture id "1")and it changes the gun with the floor texture!!

instead of making the floor texture on the floor and u can't see the gun.

what i am doing wrong?
You are probably using the same id for 2 different textures. I suggest loading ALL texture in the create event of the control object, like this:

Code:
 

LoadTexture("floor.jpg", 1); //Loads a texture with the texture ID 1
LoadTexture("gun.jpg", 2); //Loads a texture with the texture ID 2
//and so on...


You can NOT use the same id for 2 textures even thought you load them in 2 different objects (which I'm suspecting you did).
Edited by Despellanion, Nov 24 2010, 09:57 PM.
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]
did that,

but now i can't see the floor (even near light.)

i think i need to add a draw event with code or script.

so can anyone help me?
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
joihnsonlee
Nov 24 2010, 10:12 PM
did that,

but now i can't see the floor (even near light.)

i think i need to add a draw event with code or script.

so can anyone help me?
send me ur game and i'll see what i can do k?
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]
here..

and forget the next post download
Attached to this post:
Attachments: doom_gun.png (3.82 KB)
Attachments: floor.jpg (3.61 KB)
Edited by joihnsonlee, Nov 24 2010, 11:09 PM.
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]
the 2 files above were in the folder gfx.

also if i'm missing a file please tell me.
Attached to this post:
Attachments: example.gb1 (111.71 KB)
Attachments: example.gmk (111.74 KB)
Edited by joihnsonlee, Nov 24 2010, 11:16 PM.
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
okay, this was really simple. In the floor object event you must have taken out CreateFloor() which I put back in for you, thats all you did wrong. Oh and I changed the texture variable for the floor to 2.
Attached to this post:
Attachments: noobexample.zip (204.79 KB)
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
joihnsonlee
Advanced Member
[ *  *  * ]
how do i change the texture on the walls?


tried loadtexture("gfx/wall.jpg",3) in create event in control object but it doesn't do anything.

and i haven't deleted the createwall script

------------------------------------------------------------------------------------------------------

also how can i have one floor red and one floor blue?

------------------------------------------------------------------------------------------
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply