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 (TedMar, AndrewAMD), 1,344 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How change vertex normal? #267854
05/26/09 14:20
05/26/09 14:20
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline OP
Member
XD1v0  Offline OP
Member

Joined: Jun 2008
Posts: 151
Ukraine
I try inverse all normals in the mesh, but ent_getvertex /ent_setvertex do not work or i do something wrong?
Code:
 
 function invert_all_normals (ENTITY* ent)
{
	CONTACT* c;
	VECTOR inv;
	int i;
	i = ent_status (ent,1);
	for (;i>0;i--) {
		c = ent_getvertex (ent,NULL,i);
		vec_set(inv,vector(c.nx,c.ny,c.nz));vec_inverse(inv);
		c.nx = inv.x;c.ny = inv.y;c.nz = inv.z;
		//c.v.nx = inv.x;c.v.ny = inv.y;c.v.nz = inv.z;
		ent_setvertex(ent,c,i);
	}
}


Last edited by XD1v0; 05/26/09 14:22.

A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: How change vertex normal? [Re: XD1v0] #268341
05/28/09 17:57
05/28/09 17:57
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline OP
Member
XD1v0  Offline OP
Member

Joined: Jun 2008
Posts: 151
Ukraine
Looks like i try do impossible thing, I think that if i change normal of vertex i can change face orientation, now i see that is stupid, anyway i solved this using ent_getmesh/ent_setmesh.


A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram

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