eight

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • eight
    Participant

    Yes, setMatricesWindow sets the viewport and its origin. The fresh Simple Client shows the correct size of the crop area, so I think the bug is in the crop procedure itself. Anyway, even with the current state, I can move on, since I seem to have been able to solve main issue of dynamically cropping the textures on the graphics card and handing them over to isadora — thanks to Syphon!

    http://post.scriptum.ru/svalka/serverClient.png

    Best regards and thanks — you guys are great.

    –8

    eight
    Participant

    Hi bangnoise!

    Thanks a lot, I am almost there. I tried your suggestion to use bindToDrawFrameOfSize and unbindAndPublish, and got my warped and cropped image in the Simple Client…with up to 60 fps (which is the whole point of this exericise!) with a caveat. It seems the Simple Client draws a larger size texture, than I am calculating between the bind.. and unbind..

    http://post.scriptum.ru/svalka/syphonClientWarpandcrop.png

    Here is a code I am using, I think it should be clear what I am doing:

    void dragToSyphon::draw()
    {
    	glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
    	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    
    	Rectf cropRect = Rectf(0.5f * mTexture.getWidth()+shift, 0.0f * mTexture.getHeight(), 1.0f * mTexture.getWidth()+shift, 1.0f * mTexture.getHeight());
    
    	mScreenSyphon.bindToDrawFrameOfSize(cropRect.getX2() - cropRect.getX1(),cropRect.getY2()-cropRect.getY1());
    
    	gl::setMatricesWindow(getWindowBounds().getWidth(), getWindowBounds().getHeight());
    
    	gl::pushModelView();
    
    	//mTransform is responsible for warping -- calculated using opencv library
            gl::multModelView( mTransform );
    
    	mTexture.enableAndBind();
    
    	Rectf warpRect = Rectf(0, 0, mMovie.getWidth(), mMovie.getHeight());
    
    	//Cropping
    	drawTexturedRect( warpRect, cropRect, true );
    
    	gl::popModelView();
    
    	mScreenSyphon.unbindAndPublish();
    	mTexture.unbind();
    
    	gl::color( Color( 1, 1, 1 ) );
    }

    Entire cpp file: http://post.scriptum.ru/svalka/dragToSyphon.cpp

    –8

    in reply to: Building a Syphon Cinder block application in Eclipse CDT #4692
    eight
    Participant

    Actually, I figured that out — I simply can change the texture type to my type and that fixed the scaling issue. However the crop and warp still aren’t transferred to the client, but rather an unwarped complete texture: http://post.scriptum.ru/svalka/dragToSyphon.png, when i get the texture to publish via a ci::gl::Texture mTex = ci::gl::Texture(ci::app::copyWindowSurface());

    I would appreciate your thoughts how this should be done properly.

    Thanks

    –8

    in reply to: Building a Syphon Cinder block application in Eclipse CDT #4691
    eight
    Participant

    I am trying to crop and warp a very wide image in cinder and pass it over to isadora via syphon cinder block. I looked in the documentation, but still can’t figure out how the scaling is done and what texture formats are supported in

    [(SyphonServer *)mSyphon publishFrameTexture:texID textureTarget:GL_TEXTURE_2D imageRegion:NSMakeRect(0, 0, inputTexture->getWidth(), inputTexture->getHeight()) textureDimensions:NSMakeSize(inputTexture->getWidth(), inputTexture->getHeight()) flipped:false];

    calls.

    My cropped and warped texture is displayed correctly in cinder (http://forum.libcinder.org/topic/crop-image-with-polygons#23286000000721008), then frames are published into a syphon server via above call, but in the Simple Client they are blown up (please see the picture: http://post.scriptum.ru/svalka/dragToSyphon.png

    (cinder display on the left, client display on the right)

    I would appreciate a clarification about the texture formats and scaling rules while publishing frames on the Syphon server.

    Thanks.

    –8

    eight
    Participant

    Thanks, vade. After reading about frameworks, I realized that it is possible to link against them in Eclipse CDT. For the record: Project Properties->MacOS X C++ Linker ->Miscellaneous->Linker flags.

    I only now need to teach it to compile .mm files (they come with the cinder block) together with the corresponding *.h files.

    –8

    eight
    Participant

    I find developing in Eclipse CDT faster, mostly due to the content assist, class/method/calls navigation etc. It is a full fledge C++ IDE, with all the features you mentioned plus a debugger.

    Now, if syphon was available in the form of a compiled library, such as a *.a files, then I would have no problem setting up the references to it in the Eclipse CDT project. I, however, don’t see any option to link “frameworks”. Is the latter a Objective C notion? If so, I have not found a way to compile Objective C program in Eclipse CDT.

    Is it possible to recompile syphon into regular *.a libraries?

    Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)