Skip to content

Instantly share code, notes, and snippets.

@drakeirving
Created May 16, 2016 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drakeirving/8283a5ed47061c19bc4cc4d26e849226 to your computer and use it in GitHub Desktop.
Save drakeirving/8283a5ed47061c19bc4cc4d26e849226 to your computer and use it in GitHub Desktop.
Junko BG Test
task TCardBG(){
let v = 384;
let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
ObjPrim_SetTexture(obj, test);
ObjPrim_SetVertexCount(obj, (v+1)*2);
ObjRender_SetPosition(obj, 192, 128, 0);
let x = 0;
loop{
ascent(i in 0..v+1){
ObjPrim_SetVertexUVT(obj, i*2, 64+x, 0+(512/v)*i);
ObjPrim_SetVertexUVT(obj, i*2+1, 448+x, 0+(512/v)*i);
}
ascent(i in 0..v+1){
ObjPrim_SetVertexPosition(obj, i*2, 384*cos((360/v)*i-90), 384*sin((360/v)*i-90), 0);
ObjPrim_SetVertexPosition(obj, i*2+1, 0, 0, 0);
}
x++;
yield;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment