I was trying to get a bezier surface rendered but I am in need of extra documentation or help.
Since I use the gum matrix function and render functions I also wanted to use the gum version of the bezier function.
here is what I have:
Code: Select all
int GraphicsObject::RenderExampleBezier() {
sceGuDisable(GU_TEXTURE_2D);
lineVertex* Bezier = (lineVertex*)sceGuGetMemory(4 * sizeof(lineVertex));
Bezier[0].color = 0xffff6b38;
Bezier[0].x = 0.0f;
Bezier[0].y = 20.0f;
Bezier[0].z = 0.0f;
Bezier[1].color = 0xffff6b38;
Bezier[1].x = 0.0f;
Bezier[1].y = 0.0f;
Bezier[1].z = 5.0f;
Bezier[2].color = 0xffff6b38;
Bezier[2].x = 5.0f;
Bezier[2].y = 0.0f;
Bezier[2].z = 5.0f;
Bezier[3].color = 0xffff6b38;
Bezier[3].x = 5.0f;
Bezier[3].y = 0.0f;
Bezier[3].z = 0.0f;
/*for(int i=0; i<3;i++) {
for(int j=0;j<3;j++) {
Bezier[i*3+j].color = 0xffff6b38;
Bezier[i*3+j].x = (float)i * 5.0f;
if(i!=j)
Bezier[i*3+j].y = 0.0f;
else
Bezier[i*3+j].y = 20.0f;
Bezier[i*3+j].z = (float)j * 5.0f;
}
}*/
sceGumMatrixMode(GU_MODEL);
sceGumLoadIdentity();
//sceGuPatchDivide(2,2);
sceGuPatchPrim(GU_TRIANGLE_STRIP);
sceGumDrawBezier(GU_COLOR_8888 | GU_VERTEX_32BITF | GU_TRANSFORM_3D, 2, 2, 0, Bezier);
sceGuEnable(GU_TEXTURE_2D);
return 0;
}
1.) sceGuPatchPrim has no gum variant, in this case does it work with the gum variant of the drawbezier?
2.) The vertices that have to be passed, should they be with a 4x4 bezier field only 16 points? or do I have to match the number of vertices when I should create that field using triangles or trianglestrips?
3.) In the documentation, sceGuPatchPrim only can have 3 primitives, is this correct or are the three just examples of all other primitives as in the drawarray function.
4.) Last but not least, What am i doing wrong? any ideas, suggestions ?
greets ghoti