Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (Nymphodora, AndrewAMD, TipmyPip, Quad, Imhotep), 847 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
z buffer bug/problem ? #455077
10/07/15 15:19
10/07/15 15:19
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
hi , i am using this to draw triangles in my project :

Code:
LPDIRECT3DDEVICE9 pd3dDev;
					pd3dDev = (LPDIRECT3DDEVICE9)draw_begin();
					if (!pd3dDev) return;
					
					// set some render and stage states
					pd3dDev->SetRenderState(D3DRS_ALPHABLENDENABLE,FALSE);
					pd3dDev->SetRenderState(D3DRS_ZENABLE,TRUE);
					pd3dDev->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE);
					pd3dDev->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG2);

//.. 
					for(i=0;i<tcount;i++)
					{
						
						MD3DVERTEX v[3];
						v[0].x=vbuf[tbuf[i*3]*3];
						v[0].z=vbuf[tbuf[i*3]*3+1];
						v[0].y=vbuf[tbuf[i*3]*3+2];
						
						v[1].x=vbuf[tbuf[i*3+1]*3];
						v[1].z=vbuf[tbuf[i*3+1]*3+1];
						v[1].y=vbuf[tbuf[i*3+1]*3+2];

						v[2].x=vbuf[tbuf[i*3+2]*3];
						v[2].z=vbuf[tbuf[i*3+2]*3+1];
						v[2].y=vbuf[tbuf[i*3+2]*3+2];

	  					pd3dDev->SetFVF(MD3DFVF_D3DVERTEX);
	  					pd3dDev->DrawPrimitiveUP(D3DPT_TRIANGLELIST,1,(LPVOID)v,sizeof(MD3DVERTEX));

}



it draws fine ,except for somethings i have difficilty with:

the triangles are drawn over other draw_box3d and draw_line3d calls , this is the thing that bothers me the most ,why would this happen , i tried enabling z buffer,it happens with line drawing still.
i don't know if its me or a bug?

Last edited by Wjbender; 10/07/15 15:22.

Compulsive compiler
Re: z buffer bug/problem ? [Re: Wjbender] #455369
10/17/15 21:47
10/17/15 21:47
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline OP
User
Wjbender  Offline OP
User
W

Joined: Mar 2012
Posts: 927
cyberspace
solved ,i needed alpha.


Compulsive compiler

Moderated by  HeelX, Spirit 

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