Howdy, Stranger!

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

Supported by

Adding new Backend

Hey all,

I'm attempting to set-up a new backend that expands pygame for 3D object creation (cubes/spheres/etc.). What files are necessary to add/edit in the source for that? I played around with it last night on a copy of the source code from github and really just want to add a file to the _canvas folder for taking rect/circle parameters and converting them to PyOpenGL 3D objects for testing purposes. Any guidance is much appreciated!

Thanks,
Josh

Comments

  • Hi Josh,

    I'm attempting to set-up a new backend that expands pygame for 3D object creation (cubes/spheres/etc.).

    The way that the legacy backend and Expyriment use PyGame doesn't allow for 3D objects. So I think you will have to re-implement things from scratch (right @fladd?).

    I played around with it last night on a copy of the source code from github and really just want to add a file to the _canvas folder for taking rect/circle parameters and converting them to PyOpenGL 3D objects for testing purposes.

    I would take https://github.com/smathot/OpenSesame/blob/master/openexp/_canvas/legacy.py as a template, copy it to (say) my_backend.py, remove all the legacy-specific content, and re-implement all the functions.

    Then, you can edit the general script of the experiment, and simply set canvas_backend to my_backend.

    Creating a new back-end is not terribly complicated (or at least not the connection with OpenSesame), but it may not be completely self-explanatory either. I'll see if I find time to add a simple page about this to the documentation site.

    For now, the most important thing to know is that the @configurable decorator captures all the style keywords and uses them to set object properties. That's why the style keywords are not actually keywords to the functions in the backend. Does that make sense?

    Cheers!
    Sebastiaan

  • @sebastiaan @imnotamember

    Yes, that is correct. Although we would love to have a native 3D stimulus type in Expyriment that directly operates on OpenGL enabled surfaces! Having this in Expyriment would directly benefit OpenSesame of course.

    Right now we have a base visual stimulus class that operates on PyGame surfaces and has the option to copy surface data to an OpenGL texture.
    My basic plan for the future is to have an additional base stimulus class OpenGLVisual that direcly operates on OpenGL enabled surfaces. Instead of using PyGame's drawing primitives, it would rely on OpenGL drawing primitives (but abstracted of course) - it would, however, still draw on an OpenGL enabled PyGame surface/window. This new base stimulus could support both 2D and 3D objects (based on camera view). From this new base stimulus other stimulus classes could then be inherited (just like all our stimuli now do inherit from Visual), and implement stimulus specific features (e.g. Cube, Sphere, etc.).

    The reasons we haven't started working on this yet are (1) time, and (2) no deep knowledge/experience with OpenGL (I have some - enough to implement what is there right now, but my knowledge in this area is limited).

    So if you are planning to implement a 3D OpenGL stimulus, please also consider for a moment to implement it on the lower Expyriment level, as it would (a) benefit two projects at the same time (i.e. Sebastiaan can wrap it in the xpyriment backend) and (b) would not introduce yet another backend into OpenSesame.

    Please get in touch with us, if you are interested.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games