Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (NnamueN, 1 invisible), 1,489 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
create a pattern texture #229836
09/30/08 20:35
09/30/08 20:35
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline OP
Senior Member
Ralph  Offline 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.
Code:
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: Ralph] #229875
10/01/08 09:19
10/01/08 09:19
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
nice wink


3333333333
Re: create a pattern texture [Re: Quad] #229934
10/01/08 18:34
10/01/08 18:34
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

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: Vadim647] #229936
10/01/08 18:54
10/01/08 18:54
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline OP
Senior Member
Ralph  Offline OP
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
This is for people with the Lite-C(free version) like me.
We cant use levels so we have to use models and i dont want to have a ~5mb model only for the ground because i have to create a 2048x2048px texture or scale the texture extremly down.

Ralph

Re: create a pattern texture [Re: Ralph] #230085
10/02/08 17:57
10/02/08 17:57
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

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 Offline OP
Senior Member
Ralph  Offline OP
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Originally Posted By: Vadim647
Realize it. Texture points can be placed at any coords.
Lemme show it.
MegaFloor
:P

I doesnt know that, sorry guys. frown
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 Offline
Serious User
Nidhogg  Offline
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 Offline
Senior Expert
Quad  Offline
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

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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