Topic: [Engine] Quads - How do I render them?
Can someone give me an example how to render this? Can the corners be colored separately?
"Use freeform quads" is not the answer I'm looking for.
You are not logged in. Please login or register.
Teeworlds Forum → Support → [Engine] Quads - How do I render them?
Can someone give me an example how to render this? Can the corners be colored separately?
"Use freeform quads" is not the answer I'm looking for.
Could you possibly be more specific on what you want to do? What exactly do you need help with? What topic are we talking, programming or mapmaking?
I do assume that you mean some Python stuff, so I probably cannot help you.
Clarify the the topic's name please, so no one gets confused.
Added "[Engine]" to the topic subject. Should be clear enough to anyone who's capable of answering to my question.
Answer could look something like this:
IGraphics::CFreeformItem Freeform( ... );
Graphics()->QuadsDrawFreeform(&Freeform, 1);
What I'm really after is the ... -part.
// set colors (optional)
IGraphics::CColorVertex aColors[4] = {
IGraphics::CColorVertex(0, p1_color.r, p1_color.g, p1_color.b, p1_color.a),
IGraphics::CColorVertex(1, p2_color.r, p2_color.g, p2_color.b, p2_color.a),
IGraphics::CColorVertex(2, p3_color.r, p3_color.g, p3_color.b, p3_color.a),
IGraphics::CColorVertex(3, p4_color.r, p4_color.g, p4_color.b, p4_color.a)
};
Graphics()->SetColorVertex(aColors, 4);
// set texcoords
Graphics()->QuadsSetSubsetFree(p1_tex.u, p1_tex.v, p2_tex.u, p2_tex.v, p3_tex.u, p3_tex.v, p4_tex.u, p4_tex.v);
// specify positions
IGraphics::CFreeformItem(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y);
// submit draw call
Graphics()->QuadsDrawFreeform(&Freeform, 1);
(untested but should work)
FreeformItem's order was actually (p1, p2, p4, p3) and coloring works as it is.
Just testing.
Thanks BeaR!
Teeworlds Forum → Support → [Engine] Quads - How do I render them?
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.