|
Say the coordinates of your point in world space are given by the vector P, and it has an orientation vector n. I'm not sure what exactly what you mean by "draw a rectangle around it" but I'll assume you want the rectangle in a plane perpendicular to n. You'll also need an "up" direction perpendicular to n to orient the rectangle - we'll say that's u. If you don't have an "up" direction already we could calculate that based on the closest axis, but for now I'll assuming you have one. For ease, we'll assume that both n and u are normalized: |n| = |u| = 1. You can calculate a "right" direction vector from a cross product: r = n x u Now r and u are the basis vectors of a set of local x-y coordinates in the plane of your rectangle. Then for a rectangle of size w x h, the positions of the four corners (in world space) are: C1 = P + hu + wr C2 = P + hu - wr C3 = P - hu - wr C4 = P - hu + wr I hope that's helpful. Hobnob fucked around with this message at 17:48 on Sep 11, 2009 |
# ¿ Sep 11, 2009 17:44 |
|
|
# ¿ May 2, 2024 05:10 |
|
Unparagoned posted:I'm using opengles. I have my world or (flat board) that's all good. But the background is black. Is there a way to make the default emptiness a different color? In regular OpenGL this is set by glClearColor(R,G,B,A) - I don't think it will be any different in ES.
|
# ¿ Sep 16, 2009 00:12 |
|
PDP-1 posted:Are there any tips or tricks for debugging shader files? I don't think it will let you single-step, but Rendermonkey is useful for developing shaders. You can tweak inputs, see intermediate and final outputs, and tweak the shader code very easily.
|
# ¿ May 11, 2010 04:51 |
|
Maybe I'm missing something, but why not translate so that the tip of bone 3 is the origin (in the 'bind pose' - so that would be (L3*L2*L1)^-1 ), then perform the standard transform L3*R3*L2*R2*L1*R1?
|
# ¿ May 17, 2010 19:02 |