jit.gl.camera needs a couple of things

    Oct 18 2011 | 3:41 pm
    (spoke to Robert Ramirez at the Expo who said this is a Wesley Smith question, so...)
    Hi Wesley -
    I love the all the new jit.gl objects - especially jit.gl.camera, which is a vast improvement on controlling the camera through jit.gl.render.
    Unfortunately it's still missing a couple of features available via messages to jit.gl.sketch that I'm totally dependent upon for stereo 3D imaging.
    Specifically glfrustum (to do asymmetrical frustums) and glcolormask (to send different camera views to individual channels for anaglyph rendering).
    Can these be added as attributes to jit.gl.camera? Until that happens, I'm stuck with messaging jit.gl.sketch and won't be able to partake in any the wonderfulness of jit.gl.camera.
    Also: any chance of exposing the stereo buffers so we could do active stereo? I know it's supposed to be possible through cosm, but I've never been able to get that to work, and anyway it should be built-in - shouldn't it?
    Thanks for all the new toys!

    • Oct 18 2011 | 7:03 pm
      hi @pseudostereo +1
      I have the same demands for passive stereo in my projects.
      Bravo to you all Max6.
      I am aware of having a beta in the hands jitter for the examples give me the impression of being much more effective than Max5. BUT:) when I look at the options jit.window sync is not enabled. When I turn the sync ..... Welcome Max5 oops.
      By the way congratulations for physical objects.
      Thank you for taking the time to read my English aproximation.
      one more thing I expect the jitter million particles. Perhaps OpenCL in jitter?
      Now I await the final version of Max6 to advance in my projects.
      Thank you again for your work. I look at time my black binder of version 2.2 and 2.5 of the 1992 Max.
      A solitary pleasure.
    • Oct 18 2011 | 7:33 pm
      hi pseudostereo, I've logged a feature request for you. I'm with you on wanting to move from gl.sketch to gl.camera. This is really what we're aiming at, so I've put it on my priority list.
    • Oct 18 2011 | 8:10 pm
      thanks wesley!!!
      - pseudostereo (aka perry hoberman)
    • Oct 20 2011 | 9:57 am
      Hello, thank you for that Wesley.
      Could we have a choice of modes of stereoscopy: Anaglyph, passive and active in jit.gl.camera options?
    • Oct 20 2011 | 2:18 pm
      +6 for glfrustum (to do asymmetrical frustums), and stereo modes.
    • Oct 20 2011 | 8:23 pm
      +1 In case of a sub-context jit.gl.camera, not having glfrustum does not allow to have a different aspect ration for the capture.(try changing the viewport in the patch...) the ratio(aspect) sticks to the main window aspect ratio.
      With jit.gl.sketch (glfrustum+drawobject), you can capture a sub-context square view and reuse it in an the main rectangle render.
      Without glfrustum/glortho in jit.gl.camera, sub-compositing in 3d with the great new object is nearly useless...
    • Oct 20 2011 | 8:34 pm
      sorry, seems that using "vp_mode absolute" you get the right aspect ratio in a sub-context. but it still does not allow non 1:1 pixel ratio.
    • Oct 20 2011 | 11:06 pm
      Hi Spa. I rewrote your patch to take advantage of some new features in Max6: - use of implicit contexts (objects will automatically attach to a jit.window or jit.pwindow with an OpenGL context) - use patchcoords to place objects in a jit.gl.node sub-context
      Also, the aspect ratio should definitely key off of the dimensions of the texture being captured to. This is now fixed, so thanks for reporting that! If you want orthographic viewport set @ortho 1 or 2 depending on how you want that to look. @ortho 0 disable orthographic projection.
      I don't understand what you mean by a non 1:1 pixel ratio. Can you clarify please?
    • Oct 21 2011 | 2:53 am
      Hi Wesley, I work mainly with a modular structure with each modules working with a pseudo MVC structure. It means that in general, a object3d is encapsulated in a patch with pattr, etc... The fact that jit.gl.node must be directly patchcorded to an ob3d does not allow to use them in my structure with patchcord. By the way, it will be nice if the node (or attrui) could sync with an ob3d throught the inlet/outlet of a patch or send/receive. But I suppose it will be ... complex. Perhaps in javascript or java.
      suggestion 1: I added in my modules for ob3d an anchor attribute that allows to pre-offset the object (and it's compensated after the scale>rot>position chain). this way, i can scale or rotate an object not from it's center. well, now you can do it with a node, but i will be nice to have it directly in the ob3d attributes. and allowing ob3d to be nodes will be nice too.
      suggestion 2: I made for my own use a module that is similar to jit.gl.node, with quat calculation and so on. I designed a pull architecture that allows me to 'attach' my ob3d to another or my node. I can also choose to have an equivalent of your animmode (parent lookat). I found that beeing able to choose only to pass certain parameter (pos, sca, rot) allows to have interesting effects. for example you want the sub-object being affected by the scale of its parent in term of center2center distance, but not sub-multiplying its ownscale... hope i'm clear :)
      In my modular structure, I can easily swap an ob3d from one subcontext to another. by the way, i noticed that max6 crash if I change the sub-context name (drawto) of the node before the object. Or the other way around, i don't remember.
      About the 1:1 aspect ratio, 'jit.gl.sketch @capture 1' can contain a glfrustum that does not have the same ratio than the texture that capture it. If I work with a Stereo Side-by-side double viewport, I can only render an horizontal half squizzed image for left and right views. the pixel aspect ratio will be 2:1. Well, the point is that the texture ratio is independent of the camera view angle (Horizontal and vertical). I also mainly output for beamers, so I need to 'simulate' the asymetric frustum through glfrustum.
      So... I really wish you will make it for adding the glfrustum attribute to jit.gl.camera. It seems thats the only main piece missing for getting rid of jit.gl.sketch, appart of glcolormask, glscissors, etc...
      Anyway, thanks a lot for this amazing release.
    • Oct 21 2011 | 4:16 am
      Sorry for long text, but I suppose it's a beta thread...
      Trying to further understanding the relation between jit.gl.node and jit.gl.camera ...
      In the patch I posted, if you enable 0 the 'jit.gl.camera ctx_sub', the torus falls back into the 'ctx' render chain even if its drawto is 'ctx_sub'. you have to also enable 0 the 'jit.gl.node ctx @name ctx_sub' for it to disapear. Is it correct?
      I'm trying to find an equivalent to the way I use jit.gl.sketch with the new objects. The main interest is to be able to have a glcommand list with: _glviewport _glfrustum _gllight _glbindtexture _drawobject _ etc... and draw multiple(different) drawobject, (and eventually glbindtexture to use different texture for the same object rendered in different views.)
      On the next patch, I can't find a way to have sometimes: _ an ob3d in one camera and not in the other one _ and some objects in the two cameras I'm going to try with camera and a contextual jit.gl.sketch
      ++ is it possible to 'call' a jit.gl.light' in jit.gl.sketch? ( à la drawobject or glbindtexture) this way, I won't have to build a long light command list. is drawobject a kind of call to an cmd_list (internal jit.gl.sketch) in the ob3d?
    • Oct 21 2011 | 8:26 am
      Hi Spa, If you have crashes with jit.gl.node and you find a way to reproduce, please let use know. You can use jit.gl.node in subpatchers and the jit.gl objects in the same subpatcher will the be attached to that jit.gl.node implicitly. If you have any other examples about sketch/camera/light, please post them. We'll look to see how we can enable the same functionality but using the new objects so that it is simpler and more modular.