| 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: |
- Pages:
- 1
- 2
| changing colours or changing texture of floor and walls. | |
|---|---|
| Tweet Topic Started: Nov 24 2010, 06:47 PM (583 Views) | |
| joihnsonlee | Nov 24 2010, 06:47 PM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
please anyone tell me how to change colour and texture of the floor, walls and ceiling. using the execute script. |
![]() |
|
| 112 in actie | Nov 24 2010, 07:59 PM Post #2 |
|
Member
![]() ![]() ![]() ![]()
|
With the following function you can change the color of the model (call after the model is created):
With the variabele texture you can asign a preloaded texture to a object, in that case you have the following code:
You can also look in the help file of U3D, it's very useful! |
![]() |
|
| Despellanion | Nov 24 2010, 08:45 PM Post #3 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
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). |
![]() |
|
| joihnsonlee | Nov 24 2010, 09:07 PM Post #4 |
|
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.
|
![]() |
|
| RonBurgundy | Nov 24 2010, 09:13 PM Post #5 |
|
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 !!! | |
![]() |
|
| joihnsonlee | Nov 24 2010, 09:19 PM Post #6 |
|
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.
|
![]() |
|
| RonBurgundy | Nov 24 2010, 09:24 PM Post #7 |
|
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 !!! | |
![]() |
|
| joihnsonlee | Nov 24 2010, 09:51 PM Post #8 |
|
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? |
![]() |
|
| Despellanion | Nov 24 2010, 09:56 PM Post #9 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
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:
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.
|
![]() |
|
| joihnsonlee | Nov 24 2010, 10:12 PM Post #10 |
|
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? |
![]() |
|
| RonBurgundy | Nov 24 2010, 10:55 PM Post #11 |
|
Forum Borat
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
send me ur game and i'll see what i can do k? |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| joihnsonlee | Nov 24 2010, 11:04 PM Post #12 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
here.. and forget the next post download Edited by joihnsonlee, Nov 24 2010, 11:09 PM.
|
![]() |
|
| joihnsonlee | Nov 24 2010, 11:12 PM Post #13 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
the 2 files above were in the folder gfx. also if i'm missing a file please tell me. Edited by joihnsonlee, Nov 24 2010, 11:16 PM.
|
![]() |
|
| RonBurgundy | Nov 25 2010, 03:39 AM Post #14 |
|
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. |
| !!! DEFEND POP PUNK !!! | |
![]() |
|
| joihnsonlee | Nov 26 2010, 09:28 PM Post #15 |
|
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? ------------------------------------------------------------------------------------------ |
![]() |
|
| Go to Next Page | |
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |
- Pages:
- 1
- 2





![]](http://z1.ifrm.com/static/1/pip_r.png)



doom_gun.png (3.82 KB)
9:11 PM Jul 11