|
|||||||
![]() |
|
|
Thread Tools |
|
||||
|
Hi folks!
This week I spent most of my time creating a boundary system in BGE. And now I'm looking forward to sharing it ... A small animation showing the system working: http://www.youtube.com/watch?v=P108MdGliyM And check the blend file attached ... (just open and press "P") How it works: Setting the boundary: 1) I have two boundaries per object, the Inside boundary and the Outside. 2) The two boundaries are nominated following the rule: "Boundary_" + obj.name + "_I"(or "_O") - (e.g. "Boundary_Suzanne_I") 3) The boundaries are Collision enabled and have the property: "B_" + obj.name (e.g. "B_Suzanne") Setting the object: 1) Create an Always sensor, link it to the script boundary.py and link it to a movement Actuator called "MOVE" 2) Make sure the center of the object is in the center 3) Add the objects through an AddObject Actuator (that way they all have the same name) ![]() Now you can setup your own boundary using the script the way it is. If you need extra customization, please feel free to share the results here ![]() Problems you may have: 1) If you are parenting the boundaries to another object (e.g. the visible fake boundary in the example file), remember to apply the scale in the parent or else odd things will happen - BUG REPORT. 2)Elif the outer boundary is not tight with the inner boundary, depending on your pulse set to the sensor, the rayCast will hit the "outer face of the inner boundary". Right now, in BGE, is not possible to check the normal of the face we are hitting (or atleast in a fast/cheap way). Therefore we have these two boundary objects, and they should be very tight.Problems I have :I'm using multiple boundaries. For each object I have a different boundary. As the rayCast function doesn't have an X-Ray mode yet (BUG REPORT) the rayCast returns None when the boundaries of other objects are hit, even if the object is inside its real boundary. If you think this .Blend file will be useful for you, please copy this message below and post it as a commentary: " DEAR BLENDER GAME ENGINE DEVELOPERS (Benoit, Campbell, and others) I love your work, and I'm very happy with all the current features available in BGE. BUT please code an x-ray mode to the rayCast function (or make it the default, as I still can't see why it is different ). ![]() ![]() ![]() ![]() ![]() "As a matter of fact, I can see a way to solve this. I need only to set different height levels for different objects, and the RayCast fromPos and toPos parameters will follow. This is however, a hack, and does not solve the other problems I'm having with rayCast ![]() Forewords: * To run it properly you need the latest BlenderSVN (to use Mathutils). You can download it from Graphicall.org * Thanks to Campbell (ideasman) for the support and the sheepNav.py file, and the Apricot team and developers for the incredible work. And a big thank you to all who supports Blender and Apricot (buying DVDs, reporting bugs, coding, ...).
............................................
http://blenderecia.orgfree.com/ my scripts: |2.5| - Paste All - Twitter - |2.49| - IPO simplification - Dynamic text animator - Blender Notifier 1.0 - email, IRC and twitter using Blender - IPO Converter (from Loc, Rot, Scale to dLoc, dRot, dScale) Some artistic work: recent animation project (2009): Life In the Chesapeake Bay - old BGE project (2007): Urban walkthrough project (BGE) Last edited by dfelinto; 07-Aug-08 at 22:26. |
||||
|
#1
|
||||
|
|
|
||||
|
Sweet, how did you do the trails in your youtube video?
I am guessing it's the motion blur 2d filter?
............................................
Mike's Blender site |
||||
|
#2
|
|
||||
|
Hey thats nice! Good Job!
Terry |
||||
|
#3
|
|
||||
|
Quote:
Test 01 - http://www.vimeo.com/1492170 Test 02 - http://www.vimeo.com/1492070 This tracking was made using the motion blur 2d filter with a very high value (0.997 I think). The idea comes from .. you, hehhe Thanks Mike ![]() Quote:
I'm still working on it. When my object go inside the inner boundary something it doesn't return back. (in the video you can see some of them).
............................................
http://blenderecia.orgfree.com/ my scripts: |2.5| - Paste All - Twitter - |2.49| - IPO simplification - Dynamic text animator - Blender Notifier 1.0 - email, IRC and twitter using Blender - IPO Converter (from Loc, Rot, Scale to dLoc, dRot, dScale) Some artistic work: recent animation project (2009): Life In the Chesapeake Bay - old BGE project (2007): Urban walkthrough project (BGE) |
||||
|
#4
|
|
||||
|
I coded a following ground script that probably will be integrated with the boundary.
The file is attached, press "P". Also there is a cool think I would like to share: Code:
This create a kind of offset. The object is always aligned with the ground that was hit in the last pulse. It's not a problem for me, and that way I have a smooth transition ... (so far I was trying to follow the ground that way - http://blenderartists.org/forum/show....php?p=1184289) Attached there is a test with different delay pulse values and the value in the script (rotX = angle * 0.02 / deltaTime).
............................................
http://blenderecia.orgfree.com/ my scripts: |2.5| - Paste All - Twitter - |2.49| - IPO simplification - Dynamic text animator - Blender Notifier 1.0 - email, IRC and twitter using Blender - IPO Converter (from Loc, Rot, Scale to dLoc, dRot, dScale) Some artistic work: recent animation project (2009): Life In the Chesapeake Bay - old BGE project (2007): Urban walkthrough project (BGE) Last edited by dfelinto; 08-Aug-08 at 19:57. |
||||
|
#5
|
|
||||
|
Im sure this dosnt give the same level of control but heres a version that works with just 2 logic bricks, no python. (only with latest svn)
You should be able to adjust the settings through python to have some control at least. http://members.optus.net/~cjbarton/BA_Following_Ground_NoPy.blend
............................................
BPython Cookbook * How to get features into Blender * Code Metrics Hire Me ideasman42<at>gmail.com |
||||
|
#6
|
|
||||
|
I tested here and the performance is a little worse.
And check the path, is not so smooth: http://img379.imageshack.us/img379/4205/ssbk3yj7.jpg Maybe it is because the ray is not always vertical (since we are rotating the object? ). Hm a good option would be to set the ray direction locally (considering the orientation of the object) or globally (as a global z ray as I'm using in the script). Thanks Campbell (and thank Benoit )
............................................
http://blenderecia.orgfree.com/ my scripts: |2.5| - Paste All - Twitter - |2.49| - IPO simplification - Dynamic text animator - Blender Notifier 1.0 - email, IRC and twitter using Blender - IPO Converter (from Loc, Rot, Scale to dLoc, dRot, dScale) Some artistic work: recent animation project (2009): Life In the Chesapeake Bay - old BGE project (2007): Urban walkthrough project (BGE) |
||||
|
#7
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|