Jit.LCD & Matrix Line

2000's icon

Hello,

Sorry for the clumsiness of this question. I hope it's understandable.

Is there a straight forward way of using the position and line commands, or some kind of equivalent, of Jit.LCD with a Matrix using float32? Or some way of combining them?

Thank you

Roman Thilenius's icon

i don´t think so.

lcd is 8 bit by definition (and no longer supported since 15 years.)

mgraphics will accept colors in float, but it will only output char as well. even if you put mgraphics in float32 mode, which is legal, the actual color resolution it sends out will still be cropped to char.

a custom translation system from the lcd commands you already known by heart to shaders (jit.gl.pix?) will probably fail because of the completely different logic of these two worlds.

you best bet will be to use 8 bit to draw to lcd, then replace the color values later in the float 32 matrix world. for example by adding the difference between the float value and the original 32 bit value using jit.expr. or by drawing only black and white stuff in lcd and then colorizing the results.
as you can guess, this wil not work for circles, diagonal lines or for geometric positions using float.

make sure to read about the range of the "normalized" float values in jitter before you start.

TFL's icon

[jit.gl.sketch] has fairly similar commands and logic as [jit.lcd], although it uses 3D normalized coordinates instead of 2D pixels coordinates.

If you provide a patch we could probably help porting it.

2000's icon

Hi Both,

Thank you for your answers.

I had been given this patch in response to a question a few weeks ago. It does exactly what I had asked for at the time. Display a function object in Jitter. I have, however, been struggling with isolating, understanding, the line instruction. How to use it in isolation.

The jit.gl.sketch definitely seems close to what I'm looking for, but again I'm struggling to understand how it works. My knowledge is so basic I do not know what the third coordinate is for.

In terms of porting a patch. I've just been spending time with line instructions regarding position and line in the help file of Jit.LCD.

Thank you

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Ramirez's icon

the 3rd number is the Z position, which is used when rendering 3D imagery and can be ignored for strictly 2D imagery. Perhaps this tutorial helps.

The patch you posted is great. What are you hoping to do with it?

Roman Thilenius's icon

jit.gl.node must be put in float32 already, then it does what you want.

like you want to set Z always to 0, alpha (the fourth color value) can also just be left out if you want "1"

2000's icon

Thank you both.

It's do with an idea for a project. I can take no credit for the patch design. That was Matteo Marson. & Rob, you may not remember, but you helped with developing the scaling section.

Edit.

Although, that may have been a later iteration of the patch.