Need help on the physics of angry-birds [closed] - matlab

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
As a school project i have taken up making an angry birds clone in matlab. After working on it a little bit, i have realized that perhaps i bit more then i could chew.
Currently i am working on the physics of it, and while i understand the mechanics behind the game (collisions, inertia and whatnot) i don't know how i will implement it in the game. I am new to programming but i like it and have caught on to it fairly quickly.
In angry birds we are dealing with collisions between several OBB's and i have an algorithm for detecting collisions. I have a function that checks all the corners of every box and looks to see if it is within another box. I realize this is not the best way to do it but since i couldn't visualize the separating axis theorem, i chose not to use it.
When the collision happens, the box is penetrating into another box, when this happens i do a liner interpolation between its previous point and the current point. I do this to all colliding points in one instance (this is my method to resolve multiple collisions). Using the interpolation i detect the first collision that takes place and i implement a collision response.
My issue currently is that when there is one box sitting on top of another, this method doesnt work so well, because at every instance the top box penetrates into the bottom one very slightly, and i bounce it back. This causes my entire thing to stop, because i go back in time, solve the collision, and then in the next instance the collision is happening again.
My question is, how do i solve this problem of multiple boxes sitting on top of one another.
I have looked at all of the articles on physics by http://www.wildbunny.co.uk and tried to understand his method but while i understand what he does, i have no clue how he does it. I also do not know any action script so much of his code is gibberish to me.
I have looked through several other guides on the internet but none of them seem to make sense to me.
Here is what would be of great help to me, if someone could tell me what sort of method is commonly used to implement the graphics of a game like angry-birds, specifically the multiple collisions method (is mine good enough or do i need to do speculative contacts like wildbunny talks about in his blog), and the box resting on box problem.
Is this project difficult to do withing two weeks?

Yes, Implementing a robust multiple body physics engine in matlab, from scratch, without experience working on physics engines and without programming experience is too difficult for a two week project.

Related

How to Access Multiple Classes data in One MainClass? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am working on one of big project.so that's why my application contains a lot of coding. Interesting thing about this project is that it contains only one mainview and this mainview contains 25 subviews, each subview contains UITableview.so problem for me is that if I declare all these subview and uitableview in mainview along with different function which I need for every subview it create confusion. Now to make it easy I want to create separate class for each subview, but I am not familiar with how to access all these classes in my mainviewviewcontroller. Still if some one not able to understand my problem then please visit this link. http://chris-software.com/index.php/2009/05/02/passing-data-between-classes/
It seems from your comment that you already have coded something like you have mentioned in your problem, and now, you trying to make your code scalable and making it separate as zoul has suggested.
As zoul has mentioned, There isn't any exact solution to your problem, as your problem is also not exact, or say specific.
Unfortunately, It is not fully possible what you are trying to achieve, as you have mentioned in your comment. But, Let me try to give you some hint that you may find useful when refactoring your code.
Decide what data needs to be shared among the different classes.
Decide View Controllers for your application. By saying this I mean, number of View Controllers, as your application might need. It also may be possible that you can accomplish the task with less number of view controllers.
If size of shared data is considerably large then, I would suggest that you would SQLite or CoreData for that, whichever suits your need.
Specific query is welcome.
Best of luck :)
Additional Note: Try to follow the design pattern provided by Apple, most importantly in the initial phase of SDLC.
First, certainly do split the code into separate controllers or views, otherwise you would enter the world of pain. Second, it's hard to answer your current question here on Stack Overflow, because this is a question about architecture and answering it properly requires a longer discussion about your problem; there is no ready solution.
Generally, in such cases you want to build the individual screens or views as separate controllers with interfaces that allow them to be connected together as needed. (Try hard to design the individual controllers to know as little about the others as possible.) Then you can have one class that will create all the components and connect them together. There are many particular tools that can help with that, especially the UIViewController containment API introduced in iOS 5.
Going by your problem of using the same code in a new/different class time to time, re-usability is the key.
But to get this correct you must follow the "Loose Coupling and High Cohesion" principle.
Essentially, you need create each sub-view like a component by itself, which performs a specific task and is not aware or dependent on external factors like its parent etc.
Lastly, I feel the main problem you are facing trying to resuse code is because you are using IB for wiring up function to UI events.
I would suggest using target and selector properties for wiring as this will ease resuability and also keep your code discreet and cleaner.
You can read more about coupling and cohesion here Loose Coupling and High Cohesion

Drawing on the iPhone

Hello kind computing people,
Okay this is super broad, but I thought I'd give it a shot.
I've made an iPhone app using the Speak Here example project. The app works great, but now I want to use the equalizer bar independent of the actual audio input (i.e. to make it into a 'Loading Bar'). The thing is the Audio argument used to feed data into the graphics code seems to be quite intermeshed with the structure of how the graphics are created. I've been hacking around for quite a while, but I can't help feel like a cat chasing it's tail
Any advice on how to approach this? Anybody have any experience doing this?
I'll take any help I can get, including questions that may help me narrow down what I need to do.
EDIT 1
In particular I want to do some animations while there is NO input to the mic or output to the speaker i.e. when the argument to lvl_meter is NIL.
Both LevelMeter and GLLevelMeter look to be pretty reusable -- neither one has any ivars that's specifically audio-related.
That said, the code is from 2008-2009, so it may not reflect the best way to do things now. Also, it looks like it should be pretty easy to roll your own level meter. Have you tried that, and if so, what didn't work?

Are there any UAV simulation environments? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'd like to play around with computer vision and AI techniques without having to spend money on hardware right away. If there aren't any robotics simulation environments that model flight physics, could someone recommend the fastest/easiest way to make one? I don't want to make one from scratch, of course, but maybe it's possible to easily "glue" some existing apps together?
As far as flight simulators go, X-Plane is by far the most realistic as far as air dynamics are concerned. Not only does that make X-Plane sound like a good choice for you, but you can create planes very easily using provided software and write plugins in either C++ or Python (I believe there still is a plugin for that) that can control/modify the environment. Plus X-Plane is actively worked on.
www.x-plane.com
If you only want to simulate physics, this C++ code is very simple of following as well is well documented with well known references: http://jsbsim.sourceforge.net/
Actually, this is one of the physics model avaiable in Flightgear
A couple of ideas: First, I know Microsoft have discontinued their Flight Simulator, but it has an API and by all accounts the community surrounding it continues to thrive. That might be worth investigating.
Secondly, What about writing a quick little "simulator" that uses either Bing Maps 3D or Google Earth? Richard Brunditt (http://rbrundritt.wordpress.com/ ) wrote a simulator for Bing Maps 3D so that might be worth investigating.
Finally once you think you have something reasonably good, and if you have a lot of open space, you could try a model aircraft...
You should have a look at Simplysim they have a demo of accurately simulating a UAV
http://www.simplysim.net/index.php?p=gallery&id=2
It looks very impressive!
"The SimplyCube can be used for advanced simulation projects, such as UAV (unmanned aerial vehicle) simulations. In this UAV simulation, we have represented the DraganflyerX6 drone, which can be controlled either manually or automatically. A camera is mounted on the drone, as well as inclinometers, which permit to judge of the realism of that simulation which includes wind."

matlab object detection and tracking

I m doing a research project on "Object detection using my a digital camera".
Some suggestion on how to build and program the Matlab code.
In particular, I have a picture of one object, say a screen of my laptop. Than I rotate the laptop and I shot a new picture. I would like to know the difference on the position of the screen. I think I can use the edge detection after a subtraction of the two images but... it is quite difficult for me to implement it.
Some suggestion on how to build and program the matlab code.
That largely depends on the goal you want to achieve. Can you be more specific? Are you streaming the frames or are you tracking offline?
In particular, i have a picture of one object, say a screen of my laptop. Than i rotate the laptop and i shot a new picture. I would like to know the difference on the position of the screen.
There are many ways to do this, and an extensive litterature on the subject. I don't believe anyone would write up the equivalent of a survey paper on the subject as an answer on StackOverflow. Why don't you get started with an object tracking survey paper and then ask a more precise question?
hi, I m doing a reasearch project on "Object detection using my a digital camera". [...] I think i can use the edge detection after a subtraction of the two images but...is quite difficult for me to implement it.
What is your question? Are you asking us if this is a good way to track objects? Are you asking us if this is a new approach and has never been done? Are you asking someone to implement it for you?
Object tracking is a hard problem. I doubt that technique would succeed in any but the most basic scenarios. However, if you look at a survey paper, you might be pointed to a paper that already implemented this an presents results. Finally, I think you should brush up your programming skills because most (successful) object tracking techniques are not trivial to implement. If you don't want to program it yourself, there are online services where you can hire people. StackOverflow is not one of those places.
EDIT: I could deduce that you're new to both programming (in MATLAB) and in object tracking, hence in my answer. Don't mis-understand me, I'm trying to help. Let me re-phrase my suggestions as list:
Your question is far too general. You will get a lot more help from the SO community if you ask more precise questions for two reasons: A) general question result in general answers; and B) the way you asked your question could easily be interpreted as "someone, please do my work for me" even if that's not what you think you're asking.
Get acquainted with the problem domain. To ask more precise questions, you must be close to your answer. For good knowledge on the "object detection and tracking", find a good survey paper. If you're starting off on a research project, people in your lab should be of help to point you to a good one.
Learn to program simple things first. All of the most proficient (effective and efficient) programmers I've ever met struggled with the bubble sort when they were introduced to sorting. None of them would have been able to program an object detection algorithm as a first assignment. Get yourself a good image processing book that has exercises in MATLAB, go through execises one by one. If you can't do them all, choose those that are relevant to what you're trying to accomplish.

Swapping the hand holding the mouse : do you have a better idea? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Spending thousand of hours in front of my computer, ergonomics became quickly a main issue.
For the monitor or the keyboard, technical solutions exist. But for the mouse, I never get used to the trackball and putting a little pillow under my wrist made me feel uncomfortable.
So I started to swap the hand that holds the mouse. It's great, one can rest while he other is working. At the beginning it was hard, but now I don't really see the difference unless I try to kick an ass at Quake III ;-)
Anyway, a lot of people would not be comfortable with this idea, do not have the time, and above all, can not afford the mental switch that comes with the use of the other hand. Indeed, using the other hand make you use the other side of you brain (logical <=> creative), making very hard to concentrate the first times.
I am happy about it but can understand that many people would not. Do you have a better idea ?
Take regular breaks from using the mouse, and learn keyboard shortcuts!
There is a tool called Workrave which will make you take a short break every few minutes, I use it and it seems to be helping.
Yeah I had that problem too for a while. The first thing I did was modify my chair so I had a flat area where I could put a mouse and rest my arm on the padded arm wrest. Now I have an L shaped desk, and can rest my whole arm on the desk ( from elbow to hand anyway ). I found that it makes a big difference over just wresting my wrist. I still use my modified chair to hold a flight stick for gaming though ;)
This is classic RSI, you need to change your mentality for the sake of your body.
Personally I do not see why people have trouble with switching to Logitech Trackman's your hand does not move, just your thumb.
To me traditional track balls fail as you have to have your hand hovering over them or your hand bent upwards. However with the trackman your hand is put in a natural curve so it feels comfortable. I used to play Americas Army using one and had no issues with speed.
I tried a vertical mouse but found it to be more uncomfortable because you lose the wrist support afforded by resting your hand on the mouse.
It was a waste of money for me, but your mileage may vary.
Thanks for the initiative to go back to hand switching. I learned it years back, and it took about two weeks to get accustomed. Since then, I can gladly use both hands with the mouse.
Interesting home work for sports oriented: learn to play badminton with both hands. :P
This kind of exercise is generally good for our brain. Stretching it one way makes it perform better in others, too.
IBM used to make keyboards with their famous track stick in the middle. Probably, Lenovo continued that product after they took over.
If you can get used to such a device, it is very useful, especially since there is then no need to take the hands off the keyboard while working.