jsui sketch "text-like" plane

OCH's icon

in jsui sketch using 3d mode text does not take into account world rotation transformations, you can still move it around and "rotate" it in space, but it will always face the viewer straight and not get scaled. (reminds me of old 3d games, pretty funny).
I would like to create a small plane that would behave just like this, always facing the viewer.
And in fact the first use for that would be to create a little tag/box around the text, to make sure it is always legible.
Are there any jsui gurus over here that can help me in this quest?

OCH's icon

bump

Rob Ramirez's icon

i believe you just need to do something like the following pseudocode:

pushmatrix
loadidentity
plane
popmatrix
OCH's icon

Thanks @Rob,

I'm having a hard time making it work. Once I've used glloadidentity(); nothing after that gets rendered anymore. :/

it also seems that I can't really seem to be using the push and pop matrix effectivelly. Any world transformations between them seems to be affecting the rest of the scene.

OCH's icon

So, I just confirmed these with a simpler example:
glclearcolor(1,1,1,1);
glclear();
moveto();
glpushmatrix();
// glloadidentity();
moveto(-1,-1);
glcolor(1,0,0,1);            
plane(0.2);
glpopmatrix();
move(1,1);
glcolor(0,1,0,1);            
plane(0.2);

the scene should be a red square on bottom left corner and a green square on top right corner. Instead the transformation move(-1,-1); that is done between the push and pop matrix, will affect the starting position to draw the green square, and so it draws in the center of the screen.
Also, using glloadidentity(); doesn't seem to help here, and when using it with sketch.default3d(); mode it seems to break any and all rendering of the elements that are declared after it.
Would really appreciate your help understanding this, @Rob.

Rob Ramirez's icon

full patch and script and i'll take a look.

also, i'm not at all familiar with JSUI so hopefully someone with more experience can chime in as well.

OCH's icon

Please see maxproj attached here:

jsui study.zip
zip 6.39 KB

Thank you, @Rob

Rob Ramirez's icon

cool, my apologies for the misinformation. unfortunately I don't have enough knowledge of JSUI practices to offer any more suggestions.