Talk About Network

Google





Graphics > OpenGL 3D API > Re: drawing ele...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 10 Topic 4760 of 5061
Post > Topic >>

Re: drawing elements: why only one index buffer

by sheam <shea08@[EMAIL PROTECTED] > May 21, 2008 at 11:32 PM

> Now OpenGL operates on those compound vectors, which implicates,
> that in such a situation like your's you're dealing not with a
> structure like your's
> 
>> v[] = { 0,0,0,
>>          1,1,0,
>>          0,1,0 }
>>
>> n[] = { 1,0,0
>>          1,0,0,
>>          1,0,0 }
> 
> But instead with something like
> 
> typedef struct vertex {
>         GLfloat p[4];
>         GLfloat n[3];
> } vertex;


Yeah, I was just simplifying my code to emphasize my point.  My data is 
actually organized like this:

typedef unsigned int colorRGBA;
struct Vector3d { float x,y,z; };
struct Vertex
{
	float u,v;
	colorRGBA color;
	Vector3d normal;
	Vector3d coord;T2F_N3F_V3F
};

So I guess, my best bet would be interleaved arrays.  Unfortunately, in 
order to use interleaved arrays, it looks like I will have to strip out 
color, as there is no T2F_C4UB_N3F_V3F.  Which seems like kind of an odd 
omission to me.  I know of atleast two consoles which pack this way. 
Yet I don't know of one that does T2F_C4F_N3F_V3F.  Oh, well, I don't 
actually need color in most instances, so I will just make a vertex 
variant without it, and use T2F_N3F_V3F.

Thanks for the help,
~S
 




 10 Posts in Topic:
drawing elements: why only one index buffer
sheam <shea08@[EMAIL P  2008-05-21 02:38:47 
Re: drawing elements: why only one index buffer
fungus <openglMYSOCKS@  2008-05-20 19:52:38 
Re: drawing elements: why only one index buffer
sheam <shea08@[EMAIL P  2008-05-21 23:24:03 
Re: drawing elements: why only one index buffer
Wolfgang Draxinger <wd  2008-05-21 10:49:27 
Re: drawing elements: why only one index buffer
sheam <shea08@[EMAIL P  2008-05-21 23:32:01 
Re: drawing elements: why only one index buffer
Wolfgang Draxinger <wd  2008-05-22 02:55:23 
Re: drawing elements: why only one index buffer
sheam <shea08@[EMAIL P  2008-05-22 04:21:26 
Re: drawing elements: why only one index buffer
Wolfgang Draxinger <wd  2008-05-23 01:20:32 
Re: drawing elements: why only one index buffer
"jbwest" <jb  2008-05-21 17:55:50 
Re: drawing elements: why only one index buffer
fungus <openglMYSOCKS@  2008-05-21 17:58:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 14:15:14 PST 2009.