scegumdrawarray parameters

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

scegumdrawarray parameters

Post by LuMo »

my current code got
color, x,y,z
so the parameters are:

Code: Select all

GU_INDEX_16BIT|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D
the next step is:
nx, ny,nz, color, x,y,z
so the parameters should be:

Code: Select all

GU_INDEX_16BIT|GU_NORMAL_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D
followed by:
u,v,nx, ny,nz, color, x,y,z

Code: Select all

GU_INDEX_16BIT|GU_UV|GU_NORMAL_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D
note:
the struct (code for the last one) is this:

Code: Select all

class Vertex3dbV4 {
public:
	float u, v; // UV-texture
	float nx,ny,nz; // normals
	unsigned int color;// AABBGGRR
	float x,y,z;
};
is that correct?
cause something must be wrong...
loads the model correct, but puts random colors to the mesh, no shading..
greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
ufoz
Posts: 86
Joined: Thu Nov 10, 2005 2:36 am
Location: Tokyo
Contact:

Post by ufoz »

You're looking for GU_TEXTURE_32BITF.
GU_UV is used elsewhere.
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

thanks,
but the rest with the normals is correct?
weird, works without normals
but fucks totally up when using em...
greets
lumo

PS: only normals are added in class and in scegumdrawarray-parameter
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
weak
Posts: 114
Joined: Thu Jan 13, 2005 8:31 pm
Location: Vienna, Austria

Post by weak »

maybe take a look at the wiki
Vertex components are always in the order:

1. texture
2. weights
3. color
4. normal
5. vertex
or at the documentation:
Vertex order: [for vertices(1-8)] [texture uv] [weights (0-8)] [color] [normal] [vertex] [/for]
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

thanks weak! its working now....
just swapped the two lines in the class....

greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Post Reply