Gamestudio Links
Zorro Links
Newest Posts
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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, 7th_zorro, 1 invisible), 1,060 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
show wireframe view on entitys #303218
12/26/09 22:39
12/26/09 22:39
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
i have modified a script to try and create a wireframe effect but i know i have done it wrong, and whatever i try i cannot find out how to do it properly.

heres what i have:

(proberly completely wrong!)

action show_my_lines(ENTITY* me)
{
var i;
while(1)
{
i = ent_vertices(my);
var pos[3];
while (i > 0)
{

for (i = ent_vertices(me); i > 0; i--)
{
VECTOR v;
vec_for_vertex(v, me, i);
if (vec_dist(pos,v) < 10)
break;
}
draw_line3d(vec_for_vertex(pos,my,i),vector(0,0,255),100);
}
wait(1);
}
}


One day there will be an unfixable bug,
That day is not today.
Re: show wireframe view on entitys [Re: dakilla] #303251
12/27/09 12:42
12/27/09 12:42
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
It is probably better to use a simple effect in a material and then apply this to your entity. Set this as the 'effect' parameter of your material...
Code:
technique wireframe 
{ 
pass one { Fillmode = WireFrame; }
}



Last edited by DJBMASTER; 12/27/09 12:43.
Re: show wireframe view on entitys [Re: DJBMASTER] #303252
12/27/09 13:06
12/27/09 13:06
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
DJBMASTER make small corrections in your code grin for two sided wireframe
Code:
technique wireframe
 {
			pass p1
			{
				CullMode = None;
				FillMode = Wireframe;
			}
 }




A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
Re: show wireframe view on entitys [Re: XD1v0] #303255
12/27/09 13:41
12/27/09 13:41
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
or just include the mtlFX.c Predefined Surface Shaders library.

Code:
//#include <acknex.h>
#include <default.c>
#include <mtlFX.c>

function main()
{
	level_load("");
	vec_set(camera.x,vector(-30,0,10));
	vec_set(camera.pan,vector(0,-20,0));
	
	ENTITY* ent = ent_create ("sphere.mdl", nullvector, NULL);

	ent.material = mtl_wireframe;
}




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: show wireframe view on entitys [Re: rojart] #303261
12/27/09 15:16
12/27/09 15:16
Joined: Apr 2009
Posts: 141
dakilla Offline OP
Member
dakilla  Offline OP
Member

Joined: Apr 2009
Posts: 141
oh, didnt know there was wireframe in the library, thanks!


One day there will be an unfixable bug,
That day is not today.

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