1 (edited by Siile 2014-09-12 09:47:21)

Topic: [Engine] Quads - How do I render them?

Can someone give me an example how to render this? Can the corners be colored separately?

http://ninslash.com/quads.png

"Use freeform quads" is not the answer I'm looking for.

2 (edited by 2gethR 2014-09-12 09:35:05)

Re: [Engine] Quads - How do I render them?

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.

Move along, nothing to see here, really.

3

Re: [Engine] Quads - How do I render them?

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.

4 (edited by BeaR 2014-09-12 11:38:49)

Re: [Engine] Quads - How do I render them?

// 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)

5

Re: [Engine] Quads - How do I render them?

FreeformItem's order was actually (p1, p2, p4, p3) and coloring works as it is.

Just testing. tongue
http://ninslash.com/lighttest.png

Thanks BeaR!