... after glBindTexture on the specific texture?Originally Posted by arthurprs
... after glBindTexture on the specific texture?Originally Posted by arthurprs
yesOriginally Posted by User137
i have tried rendering with trianglestrip, same result =\
From brazil (:
Pascal pownz!
Try this version, use the same texture as you posted before, it renders 3 quads, uses some vector math to avoid messing with rotations.
Code:Procedure DrawLine(const PStart: TVector2f; const PEnd: TVector2f; Width: Single); var Vector : TVector2f; var Normal : TVector2f; var NXW: Single; var NYW: Single; var VXW: Single; var VYW: Single; begin Vector.X:= PEnd.X - PStart.X; Vector.Y:= PEnd.Y - PStart.Y; Vector:= Normalize(Vector); // Calculate the normal to the vector Normal.X:= -Vector.Y; Normal.Y:= Vector.X; // Precompute the factors NXW:= Normal.X * Width; NYW:= Normal.Y * Width; VXW:= Vector.X * Width; VYW:= Vector.Y * Width; glEnable(GL_TEXTURE_2D); glBegin(GL_QUADS); // First quad glTexCoord2f(0.0, 0.5); glVertex2f(PStart.X - NXW + VYW, PStart.Y - NYW + VYW); glTexCoord2f(1.0, 0.5); glVertex2f(PStart.X + NXW + VYW, PStart.Y + NYW + VYW); glTexCoord2f(1.0, 0.5); glVertex2f(PEnd.X + NXW - VYW, PEnd.Y + NYW - VYW); glTexCoord2f(0.0, 0.5); glVertex2f(PEnd.X - NXW - VYW, PEnd.Y - NYW - VYW); // Middle quad glTexCoord2f(0.0, 0.0); glVertex2f(PStart.X - NXW , PStart.Y - NYW); glTexCoord2f(1.0, 0.0); glVertex2f(PStart.X + NXW , PStart.Y + NYW); glTexCoord2f(1.0, 0.5); glVertex2f(PStart.X + NXW + VXW, PStart.Y + NYW + VYW); glTexCoord2f(0.0, 0.5); glVertex2f(PStart.X - NXW + VXW, PStart.Y - NYW + VYW); // End quad glTexCoord2f(0.0, 0.0); glVertex2f(PEnd.X - NXW , PEnd.Y - NYW); glTexCoord2f(1.0, 0.0); glVertex2f(PEnd.X + NXW , PEnd.Y + NYW); glTexCoord2f(1.0, 0.5); glVertex2f(PEnd.X + NXW - VXW, PEnd.Y + NYW - VYW); glTexCoord2f(0.0, 0.5); glVertex2f(PEnd.X - NXW - VXW, PEnd.Y - NYW - VYW); glEnd(); end;
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
the result andreaz
From brazil (:
Pascal pownz!
I don't understand, i can clearly see you have LINEAR working in that screenshot, yet it stopped working?Originally Posted by arthurprs
EDIT: forget about the errors, the code is working perfectly, the #@!@# here forgot that he changed the texture...
From brazil (:
Pascal pownz!
It should really look like this,Originally Posted by arthurprs
Well here's the complete source
http://phoenixlib.net/files/Nice_looking_lines.zip
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
Thanks Andreaz, the code works good
changing topic,
I was looking on phoenixlib sources and i noticed that you use display lists and vertexarray on particles, those method are really faster?
From brazil (:
Pascal pownz!
Yeah, vertex arrays is alot faster then intermediate mode (glBegin, glVertex, glEnd).
And displaylists can be faster then vertex arrays, atleast for static geometry. However displaylists is a tricky subject, they might be implemented in the driver and not in the gpu.
In the new version of Phoenix i'm going away from displaylists and using vertex arrays and vertex buffer objects instead.
Amnoxx
Oh, and this code appears to be an approximate replacement for return(random() & 0x01);
Phoenix Wiki
http://www.phoenixlib.net/
Phoenix Forum
http://www.pascalgamedevelopment.com/viewforum.php?f=71
Bookmarks