2 registered members (NnamueN, 1 invisible),
1,489
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
create a pattern texture
#229836
09/30/08 20:35
09/30/08 20:35
|
Joined: Feb 2006
Posts: 385 Oldenburg,Germany
Ralph
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
|
Hi guys, im creating a function that allows you to create a pattern form a texture for a model.
void patterSkin(ENTITY* ent,STRING* textureName,var factor){
BMAP* tmpBmp;
BMAP* txtBmp=bmap_create(textureName);
var txtSize=bmap_width(txtBmp);
var posx,posy,Size=clamp(factor,1,64);
tmpBmp=bmap_createblack((txtSize*Size),(txtSize*Size),32);
for(posy=0;posy<Size;posy++){
for(posx=0;posx<Size;posx++){
bmap_blit(tmpBmp,txtBmp,vector(posx*txtSize,posy*txtSize,0),vector(txtSize,txtSize,0));
}
}
ent_cloneskin(ent);
ent_setskin(ent,tmpBmp,0);
set(ent,NULL);
return;
}
//thats the way you can use the function
you=ent_create("block.mdl",nullvector,NULL);
createPattern(you,"test.bmp",4);//createPattern(entity pointer,external texture,size factor)
You can only create constant pattern with this function. I hope this is usefull and my english is not to bad (im terribly tired). EDIT: Here is a little example of the function Ralph
Last edited by Ralph; 10/01/08 07:34.
|
|
|
Re: create a pattern texture
[Re: Quad]
#229934
10/01/08 18:34
10/01/08 18:34
|
Joined: Feb 2008
Posts: 337
Vadim647
Senior Member
|
Senior Member
Joined: Feb 2008
Posts: 337
|
Nice, but I cant imagine a good use for it currently...
I switched to other account since marth 2010. Guess which.
|
|
|
Re: create a pattern texture
[Re: Ralph]
#230085
10/02/08 17:57
10/02/08 17:57
|
Joined: Feb 2008
Posts: 337
Vadim647
Senior Member
|
Senior Member
Joined: Feb 2008
Posts: 337
|
Realize it. Texture points can be placed at any coords. Lemme show it. MegaFloor:P
I switched to other account since marth 2010. Guess which.
|
|
|
Re: create a pattern texture
[Re: Vadim647]
#230086
10/02/08 18:01
10/02/08 18:01
|
Joined: Feb 2006
Posts: 385 Oldenburg,Germany
Ralph
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
|
Realize it. Texture points can be placed at any coords. Lemme show it. MegaFloor:P I doesnt know that, sorry guys. So my function is useless! MFG Ralph
|
|
|
Re: create a pattern texture
[Re: Ralph]
#230125
10/02/08 23:23
10/02/08 23:23
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
Serious User
|
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
Nice try though. Somebody might have a use for it though so don't get discouraged..
It's people like you that keeps 3DGS and Lite-c alive and popular.
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
Re: create a pattern texture
[Re: Nidhogg]
#230126
10/02/08 23:32
10/02/08 23:32
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
this could be useful when you want to tile same model a lot of times.
like you dont need to create same model 16 times for 4x4 tile, you can do this by scaling 1 model and just tile the texture.Positive effect on performance. (though, when i first saw this topic, i thought this was done to achieve this. -i guess someone was making a rpg-maker, maybe this can be useful???-)
scaling uv's can olsa be another approach, though i dont know how it is done.
3333333333
|
|
|
|