Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How make a "clip()" in 3d ?

edited August 2013 in Questions Posts: 304

clip() function are not affected by matrix transformations like translate, rotate... Have you any idea for do this ?

Thanks before !

Comments

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Clip has some utility with respect to the display only, right? Because you want to keep some areas clean for buttons etc... What excatly do you expect from a 3d clip?

  • edited August 2013 Posts: 304

    @Jmv38 : This is an exemple :
    image

    with camera eye position change :
    image

    I don't want to see the public part who exceed the "screen"

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Unfortunately your images dont show up on the forum...

  • edited August 2013 Posts: 304

    @Jmv38 for me that work, but i've add links.

  • Jmv38Jmv38 Mod
    edited August 2013 Posts: 3,295

    Maybe because you are the owner of dropbox account? When i click on the link, i get:

    ~~~
    Error (403)
    It seems you don't belong here! You should probably sign in. Check out our Help Center and forums for help, or head back to home.
    ~~~.

    sorry for this side discussion - it doesnt help you at all...

  • @Jmv38 lol, this is not your fault, excuse me for bad links. That works now ?

  • Jmv38Jmv38 Mod
    edited August 2013 Posts: 3,295

    Ok, now i can see your pictures.
    In your above example you are Not really using 3d capability, you are more trying to do a 2d scale of your dashboard, am i correct? Then you can scale the clip coordinates too.
    The problem with clip is that it is a flat rectangle, so if you do real 3d, with rotations etc, your objects will be distorded in non-rectangular way => a simple rectangular clip will not work. Now if you use only 2D scale and move, you can scale and move your clip rectangle 'by hand' too. Is this what you are looking for?

  • edited August 2013 Posts: 304

    @Jmv38 In this example, this is just a sort of 2d scale, you've right, but i think about "real" 3d with rotations. And yes, a simple rectangular is not sufficient : this is the problem.

  • edited August 2013 Posts: 304

    another better example :

    image

  • Jmv38Jmv38 Mod
    edited August 2013 Posts: 3,295

    In this case i will suggest the following: instead of doing clip() in 3d, just create an image CLIP of the size you want, sprite your images into it with setcontext(CLIP) so that the parts not to be seen are outside it (by construction it will clip this part) then sprite your CLIP image with all the 3d transforms you want. The result will be exactly what you want, i think.

  • edited August 2013 Posts: 304

    I've already think about that, but i don't remember if this solution was sufficiently fast.

  • Posts: 1,595

    I use @jmv38 solution for things like scrolling menus and clipping ellipses and stuff, it shouldn't be too slow if your only using a section of the screen

Sign In or Register to comment.