Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to use entity.material to set alpha? #72336
04/27/06 12:56
04/27/06 12:56
Joined: Apr 2006
Posts: 6
M
Majelang Offline OP
Newbie
Majelang  Offline OP
Newbie
M

Joined: Apr 2006
Posts: 6
entity* cone;

material test_mtl
{
alpha = 10;
}

function main()
{
level_load("largecube.wmb");
wait(1);

cone = ent_create("cone.mdl", nullvector, null);
cone.material = test_mtl;
}

/****************/

The opacity of the cone didn't change! What's wrong?

Thanks

Re: how to use entity.material to set alpha? [Re: Majelang] #72337
04/27/06 14:55
04/27/06 14:55
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Try this:

cone = ent_create("cone.mdl", nullvector, null);
cone.transparent = on;
cone.material = test_mtl;


no science involved
Re: how to use entity.material to set alpha? [Re: fogman] #72338
04/27/06 17:31
04/27/06 17:31
Joined: Apr 2006
Posts: 6
M
Majelang Offline OP
Newbie
Majelang  Offline OP
Newbie
M

Joined: Apr 2006
Posts: 6
If cone.transparent is set on, alpha=10 in test_mtl will be overriden by cone.alpha which the default is 50. So that the alpha=10 in test_mtl is now useless.

The purpose of this post is to see how cone.material works, not how to change the opacity.

Thanks

Re: how to use entity.material to set alpha? [Re: Majelang] #72339
04/28/06 08:06
04/28/06 08:06
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Akaik it won´t be overwritten, because you set "transparent = on" before you set the material. So the alpha value in the material will overwrite the default value of 50.


no science involved
Re: how to use entity.material to set alpha? [Re: fogman] #72340
04/28/06 19:49
04/28/06 19:49
Joined: Apr 2006
Posts: 6
M
Majelang Offline OP
Newbie
Majelang  Offline OP
Newbie
M

Joined: Apr 2006
Posts: 6
I found the engine ran in A5 mode which the material didn't work at all. I have to include d3d_transform=on to switch to A6 mode manually to get the material works. Thanks for your time.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1