Archived

This topic is now archived and is closed to further replies.

HellRiZZer

Why..!! And how??

Recommended Posts

What I''ve been trying to do is to use vertex structure in glMap2f and glEvalMesh, but they all seems to accpet only data structure as ctrlpoints[4][4][3] .. And I need to know how can I convert from my vertex structure, e.g struct float x; float y; float z; } VERTEX, *PVERTEX; to what I can do as VERTEX ctrlpoints[4][4];.... How do I go from simple data type as they use, to structs or even classes? Please help..

Share this post


Link to post
Share on other sites
if i have grasped right you have ctrplt[4][4][3]
that''s to say a 4x4 matrix each of 3 more array entryes right ?
and you want to convert it into ctrlpts[4][4].x , y , z , am i right ?
try this

int n=4 ;
for ( j=0; jfor ( i=0; i{
dest[j].x=src[i][j][0];
dest[i][j].y=src[i][j][1];
dest[i][j].z=src[i][j][2];
}


Share this post


Link to post
Share on other sites
Oh shit the post messed up my code, i hope you undedtand
that i have done two cycles

for ( j = 0 ; j< n ; j ++ )

and

for ( i = 0 ; i< n ; i ++ )

i hope this will be posted correctly
sorry again.



Share this post


Link to post
Share on other sites