|
Bullet 'Hello World' exampleI've just put together a sort of "Hello World" example of using the Bullet game physics engine in a QCPlugin : The folder contains : - a QCPlugin : tLBulletHelloWorld.plugin - a QCComposition : tLBuller_HelloWorld_b1.1.qtz - the related XCode project ( with all Frameworks , and sources included ) To start a project from the scratch you'll need to : Voila , sure there might be smarter ways to do it ..just thought this could interesting . P.
|
I'm getting "tLBullet_Hellowrld_b1.1.qtz" was not restored successfully.
This is with trying with the tLBulletHelloWorld.plugin in 'Quartz Composer Plug-Ins' or in 'Quartz Composer Patches'.
Which folder should it go in?
[I wish a future version of QC would consolidate these folders into just one Folder - or at least change the required file type of Patches to QUARTZ_FILENAME.patch ]
Also, should this Plugin/Patch appear in the Patch Library?
/Library/Graphics/Quartz Composer Patches should make it .
Strange one this. I have placed your plugin in the /Library/Graphics/Quartz Composer Patches folder but am getting the following:
Could not really reproduce the problem from here . But I'll investigate . What's your configuration though ?
P.
hello pascal i got the same problem as photonal.
Well sorry , the plugin should be copied to "/Library/Graphics/Quartz Composer Plug-Ins" , and that should make it .
( I mentioned the wrong path in the previous post )
Could it be that the comp is expecting a different 'plugin name'?
I can't find your plugin either in the Patch Library - what is it called here? (I have placed the plugin in /Library/Graphics/Quartz Composer Plug-Ins)
OK :
Would that will work for you ? :
i got this running. the plugin is looking for the bullet frameworks inside pascals documents folder.
what i did was.
download bullet and recompiled the frameworks for my computer as libs and then added them to plugin and deleted pascals frameworks and bullet src files then built the plugin.
see attached plug. built... 32/64bit i386, x86_64
bullet looks pretty sweet. i always learn a lot from tl files. this hello world is a box / sphere drop with gravity and collisions. see pic.
not really, now I get:
Cool .. Strange that the plug is looking for the bullet frameworks , outside the build since they are included in the plugin .
Thanks anyway .
I get the following with Dust's version:
have you tried with the last bundle I've attached ?
https://kineme.net/forum/Discussion/Programming/BulletHelloWorldexample#...
yes I tried the last one but got:
(null) QCPlugIn: Cannot preflight plug-in at path "/Library/Graphics/Quartz Composer Plug-Ins/tLBulletHelloWorld.plugin" (Error Domain=NSCocoaErrorDomain Code=3587 UserInfo=0x665aa0 "The bundle “tLBulletHelloWorld” couldn’t be loaded because it is damaged or missing necessary resources." (dlopen_preflight(/Library/Graphics/Quartz Composer Plug-Ins/tLBulletHelloWorld.plugin/Contents/MacOS/tLBulletHelloWorld): Library not loaded: /Users/pascal/Documents/tLBullet/bullet-2.78/src/BulletCollision/BulletCollision.framework/Versions/2.78/BulletCollision Referenced from: /Library/Graphics/Quartz Composer Plug-Ins/tLBulletHelloWorld.plugin/Contents/MacOS/tLBulletHelloWorld Reason: image not found))
yes this build works tl. just noticed the OSX stuff in bullets extra folders. i built the frameworks from bullets cmake file and got libs. "libBulletCollision.a" before i found the osx demos. nice example
sorry for the noise .. I'll be correcting that and repost . At the mean time there still an Xcode project included , to build you own .
Sorry I'm being so dim here but it seems I need to build the Bullet library before building the bullet plugin right?
or does the tLBulletHelloWorld.xcodeproj do this automagically for me?
works fine for me with xcode 4 64bit build. maybe you have qc in 32bit mode ? try building this src with native machine settings.
Well finally got it working but a nightmare to compile it!
and a great plugin btw pascal!
Well, I only picked up on this late on in the day, but it ,compiled afresh, works nicely indeed.
Thanks for sharing pascal.
PostScript //////////
Have only compiled to 64 bit thus far. 32 bit provokes an error.
I looked at for a few minutes... Patch didn't restore. I haven't read through the whole thread. Is this being setup so that bullet is an external framework? If that can be changed, it would be way better.
Same plugin , but this time the bullet engine is exported as C++ static libraries . The zip includes the QCPlugin , a demo patch , and an Xcode code project to demo how to build a project from the scratch .
You know what's a real trip... a trackball environment only changes the gl light position! Crazy! I haven't looked at the actual project yet.
Sometimes there's some weird stuff w/ QC projection / light, etc. It seems like when one implements GL Ortho/FOV/whatever type stuff, that sometimes Lighting or culling flip, or don't respond how one would think... but if you change your default parameters to be in ranges that are opposite of what is usually suggested as defaults in OpenGL literature, stuff starts looking "correct" (whatever that is...). I notice this in GL Tools and other stuff, so I know it's not just me! :)
pascal this is a great example. i took a class in physics modeling this semester so this plugin really interests me. i made a few physics examples in cl, nothing to the extent of bullet though.
actually your cl particle series helped me a lot, once i figured out how to integrate euler and verlet's into a cl particle system. now this plugin has inspired me to learn core gl programming. something i have been putting off for a while seeing there are so many higher level abstractions of the gl language.
actually working on incorporating the bullet raycast into this hello world so you can grab each box or sphere or well the nearest one to the ray cast. i almost have mesh collisions worked out by passing vertex, color, normal, and indices structures from qc to the plugin. slow going though. there really is a lot going on behind the scenes with GL that in quartz you sort of take for granted i guess let alone sorting out all the bullet classes.
i also added a trackball to the scene and noticed it updates the lights. haven't really any ideas what the issue is as i have never made a gl based plugin.
Thanks for your comments .. So , again a bullet based QC example . Not pretending to be a very useful plugin though , but just a demo on using soft bodies algorithms within the bullet engine ( needs also for sure some OpenCL implementations to run complex meshes ) . Attached : a qcplugin , a comp , and the Xcode project .
I'm doodling around in the great work done by pascal and have a question regarding rotation of the environment.
My C++ is very limited.
I declared:
btTransform* m_transform;
and am trying to use this in the '- (BOOL) execute:(id)' part of the code to rotate the 3D world via:
m_transform->setRotation(btQuaternion(0, 0, 0, self.inputRotateX));
[I've also declared inputRotateX with the other QC parameters: @dynamic inputGravityX, inputGravityY, inputGravityZ, inputRotateX; ]
It compiles but crashes when opened in QC.
Any tips very welcome.