Transforming 3D viewport vertices



  • On 27/08/2015 at 08:06, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R16 
    Platform:    Mac  ;  
    Language(s) :     C++  ;

    ---------
    Hi there,

    Is it possible to transform the vertices in the 3D viewport?
    I have a plugin that is a custom lens, so the 3D viewport is never reflecting what will be rendered. On OpenGL applications I usually do this with a vertex shader.
    I found any examples or clues on how to do this on Cinema 4D.

    Thanks,
    Roger



  • On 28/08/2015 at 02:19, xxxxxxxx wrote:

    Hello,

    Cinema 4D is no real time application and the viewport is no open OpenGL engine so one has no way to influence the viewport this way. The only thing that comes to mind are the OpenGL post effect functions of VideoPostData plugins. But these functions are not documented and no additional support can be given.

    Best wishes,
    Sebastian



  • On 28/08/2015 at 03:17, xxxxxxxx wrote:

    @Sebastian: Is there at least an example to start with? Eg. how to retrieve the OpenGL context for the active base draw?



  • On 28/08/2015 at 10:06, xxxxxxxx wrote:

    Hello,

    I don't think it is possible to get the OpenGL context of a viewport window. Cinema 4D is not intended to be modified this way.

    Best wishes,
    Sebastian



  • On 28/08/2015 at 10:18, xxxxxxxx wrote:

    I really have few experiences with OpenGL to be honest, but can you actually do OpenGL stuff without
    the main OpenGL context? :'-)



  • On 28/08/2015 at 11:18, xxxxxxxx wrote:

    Then how can the stereo vp example change how the viewport is drawn?
    If it can shift the vertices to draw 2 different point of views, can't I transform according to my parameters also?



  • On 31/08/2015 at 00:34, xxxxxxxx wrote:

    Hello,

    the VideoPostData class contains special functions to support stereoscopic functionality as seen in the example you mentioned. So what you can do in such an video post is to move the camera(s), not to move the vertices.

    Best wishes,
    Sebastian



  • On 11/09/2015 at 09:34, xxxxxxxx wrote:

    Hello Roger,

    was your question answered?

    Best wishes,
    Sebastian



  • On 11/09/2015 at 14:04, xxxxxxxx wrote:

    these are the lines that control the vertex position.
    https://github.com/PluginCafe/cinema4d_cpp_sdk/blob/master/source/videopost/vpstereo.cpp#L335-L372



  • On 11/09/2015 at 17:10, xxxxxxxx wrote:

    Looks like a fragment shader to join the stereo cameras into one. 
    I need to take a closer look into that when I have some time.



  • On 12/09/2015 at 05:26, xxxxxxxx wrote:

    Afaik, inside the Draw functions you can call OpenGL code just as usual. Worked fine for me here I clearly remember (it's a few years back but I used to draw my own polygon objects, boxes etc. so if it was possible back then it should be right now). Don't think I could retrieve the OGL context though.


Log in to reply