setting dim dynamically in jit.mgraphics
Is is not possible to set the dimension of a jit.mgraphics matrix dynamically? It does not respond to the dim message, although getdim does output the dim out of the right inlet.
Anybody? Is this a bug? Or some sort of essential limitation of the jit.mgraphics object? Is it possible that you can only set the dimensions of the matrix produced by jit.mgraphics in the arguments to the object? I tried using an attrui object as well, but the dimensions are not editable, except by literally retyping the arguments in the object box.
Don’t make me go back to using jit.lcd ;)
I’m trying to construct an alpha channel out of various drawn shapes using jit.mgraphics, but the size of the matrix I’m working with can vary dynamically depending on logic elsewhere in the patch.
There is an adapt flag, but since jit.mgraphics does not take a matrix in I can’t trick it by setting the flag and sending it a matrix that I’ve "dimmed" to the desired size.
Planecount cannot be changed either…
there does seem to be an issue with attrui and the dim attribute, however sending a message to change the dim works fine.
of course the scene is cleared/reset when you change the dim.
in general, dynamically changing matrix dims is not the best solution.
maybe either keep uniform dims (but upscaling or downscaling your source images), or up/down scale the matrix coming out of jit.mgraphics.
Your right, after doing my tests over it does seem I missed that the dim message was working, just not reporting correctly with "getdim". Below is a simple demo patch that passes the jit.mgraphics matrix to a jit.matrix object and tests dims before and after.
Just curious, why do you say that dynamically changing the matrix dims is a bad solution? I’m building a utility that can take an image or movie of any size and build a certain (precise, pixel-matched) alpha channel for it – its important that I preserve the original dimensions, which would change for every image/movie processed. I guess I need to be careful to clear the scene, then resize my jit.mgraphics "canvas" (ie dim it), then do my drawing, so that the change to the dim does not come unexpectedly…
Thanks for your help
----------begin_max5_patcher---------- 985.3oc6ZksiiiBE84TR8+.xOmwBv3s4s46n0nRdgxEU4fivjpyLsl+8gk3D msNIUicr5NOT1IWigCGNbWB02+xSy7xaVSa8.+I3qfYy9txxLiMskYcFl4sH acQcVqogdEMKVP4Ru4adnjtVZdPrOnUxpqAB5xFgrEfgP.BB21x7U440TcaQ cldogK4YKLF89KAKqdaqYkFiM4u8GnXu9uPK6es8B1G1YmuZAiWSks608Kyj Eux3UOKnER6zDECUuE.GDougBsei3CA+cu9pYkrqy1NDuHpxMF7gFK+2WdRe Wca9USdKnssYUziIuJprjsXqc63K+mkTKp871Auqiyvvaiyv+HNCEY4rT8MR rg4RNOkg9z7yYEWQ9akUDkrJvIxp.2IqHoAFJBi+0VVgHtSVQBHVNK7tIqB7 A4Y7JvhLofsFnFLfrA7FS5asr8MpYbZQyJtbuI0mW5AcnGsTjenh4f8kdAIi jzKekT1vOuBSSu8TY83fTuaepplb6lpXX20QTwP7ce7sHm6GBEA+01OTrycC ghBtatgv6DUH.5mWPE5bAUb78POcVBCM.6BwtizvJGTJ+T2mbL4zuolNGyYK ELtD7hPwoUd2X3JGJnPHhgaRM65hStjO7AkHjquUlHwcLQ.DYBUaYhDzvwDi X9goN2wbBbn8KeV5QwMckaL2jnnKKPC4vBzBiL4EEaijgf2Atx8UvhcHAQLL i0g7PJkNmOmSTRwQLjpMO20lOCeQbX.rHSMYAgFZKL7RtlvCCgUIxV9Jq33f 7Nm6bX.tD8VQr0qEBOfTmlqNn7KETrz2tzgZDkTwdIYb7Vy41+Lu7VXJTk6V RMbjoZhtNrpnotQrYekd1A8iBSRvD8mPjTHdt19tNZW01WSvVcq6MBPe77dW 1qi6G24LdSC1AbVEuQsJUyJdeukvSuvpgQyGTwUBkS4yAGeSEqFr+R1dCrgk 6tbv.KT7njJdlxy1j3K72GIUnikT4YEuWYf4dpg9JM7DToE1K7+Ck1fnzvit RiL4DZDXuLxenyFDcV7nqyvASNgVJt2ANcJg1qrxRJ+Pr7P68yo8hF+noQSP mbA8NVpGd4FDkFZzUZASvz1f69QIdnyFDcFYz0YISUGZaNfq6oPy1Zygoe3+ 0QFbqevAxu1lUhhNUyliMFzaXKosRFOSxZ38Zj92yAbxzE1tJTxZ0vr7BaHt ZbEeU3hL535PpXZALzk.FZ7WIMbwkAVx3CL7DU6qOKioIvfSTfgRmn6JQjQ. XahCjsboJvV6lt1hIU9FuYC2DM29cFuoWxDdB5GrtWIVYwzqpK+O7P6YD. -----------end_max5_patcher-----------
yeah, the dim attribute reporting is definitely broken.
thanks for pointing that out.
we’ll get this fixed up for a future update. fortunately the output matrix is correct.
it sounds like you have a specific reason for resizing, so that should work fine for your needs.
Forums > Jitter