|
I suppose that's one way to look at it. Or in this case, gravity is pulling along the Z-axis keeping the balls on the playing field, like a pool table.
If you want gravity to pull down on the Y-axis (towards the bottom of the form), I'm sure that could be incorporated by changing the value of the DeltaY property, but the math is beyond me too. Sorry.
-NP
Never underestimate the creativity of the end-user.
|
|
|
|
|
I think I might have found my own answers here actually. I'll have a play around and see what I come up with. But you were on the right track with what you said. Modify the DeltaY by adding a constant gravity component each iteration.
I guess I could also add a 'friction' component acting in the -Y and -X directions each iteration to have the ball slow due to air resistance too. Hmmm! This could be a fun experiment...
|
|
|
|
|
It seems at a first glance that it can only bounce once in one timestep, but it can in fact bounce multiple times in succession in one timestep. If you take any shortcuts there, balls can "escape", usually through the corners, and it will be uncommon enough that it could go undetected essentially forever (you can use that to decide that it's really OK, or that it's a very nasty bug, but it's good to be aware of it). If the speeds of the balls are reasonably low and the timestep is reasonably short, balls can still bounce twice, in the corners.
Also, the simple implementation of bouncing actually bounces off of a virtual surface some distance outside the box depending on how far the ball traveled outside in a step. A more correct way to implement it is calculating the intersection of the box with the half-line in the direction that the ball is traveling, then bouncing "some time in the past when it was at that position" (flipping a speed and, crucially, updating the balls position by mirroring it around the line it bounced into*), then looping until the ball is inside the box. Like the other problem, this effect gets worse and worse for higher speeds and longer time steps.
So yes, it's actually pretty complicated.
* that is why you calculate the intersection point - to get the line it first bounced into. There would otherwise be an ambiguity when the ball is in the "outside quadrant" of a corner.
modified 8-Jul-13 12:28pm.
|
|
|
|
|
As Harold mentioned you have to make a computation strategy for collisions e.g. ball vs ball and ball vs frame. Here are some terms that you can google.
You can go the variable time step way - good for getting the simulation right.
You can go fixed time step - good for having the simulation go fast.
One computation strategy could be as follows until no more collisions occur in a time step:
- within a time step calculate the next collision
- calculate the physics for involved objects
Collision checking is a discipline in itself - a moving ball within a time step can be looked at as a sweeping volume being a capsule. Collision checking results in a collision time within a time step and a set of contact points.
The physics can be as complicated as you want to. You can keep it very simple by sticking with kinematics (position, velocity) added some impulse calculation or go very exotic by adding lots of dynamics (gravity, friction, spin, energy loss, etc.).
About gravity:
If gravity is g (9.82[m/s^2]) downwards and you have a time step of deltaTime [s], all balls need to have their velocity changed by
velocity change due to gravity: deltaVg = deltaTime * g
In any case, have fun
Kind Regards,
Keld Ølykke
|
|
|
|
|
We are using a web service(asmx) to communicate with service provider.
Problem: We are getting a web exception while sending and receiving response.
Exception Details :
1) Exception Message : The request was aborted: The operation has timed out.
2) Exception Status : timeout
We are getting this timeout status within 40 seconds whereas we have set webrequests timeout property to 180 seconds.
Can anybody please suggest me the solution of this problem??
Vishal
|
|
|
|
|
vishalmudrale wrote: We are getting this timeout status within 40 seconds whereas we have set webrequests timeout property to 180 seconds. Can you verify that it's the WebRequest that's actually timing out? Can you post the entire exception?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for your reply friend,
Can you please send your solution again????
|
|
|
|
|
Thanks for your reply friend,
Can you please send your solution again????
|
|
|
|
|
vishalmudrale wrote: Can you please send your solution again???? I did not send a solution, I asked a question.
So, no, can't do.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The request was aborted: The operation has timed out.
|
|
|
|
|
You already mentioned that. I did (and will not) post a solution; there's a question that needs to be answered to find out what might be going wrong. If you are having trouble with the language, try and find someone who can help.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I started to develop a Point of sale system for Restaurant/Hotel which also include a facility of sms confirmation for customers for home delivery etc.
I think first we need a thermal printer for bills slips etc,
Please give some ideas how to start the project and what types of packages or tools used.
I use .Net C# as a developer.
modified 8-Jul-13 12:56pm.
|
|
|
|
|
This forum is supposed to be used to get people help you with with programming issues and not to collect (rip off) ideas/requirements from us.
If you are indeed developing something like that, you should come with these ideas yourself. You might even ask your potential customers for ideas if you can't come with anything by yourself.
Regards,
— Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Well, you START by gathering very detailed requirements from your customer. They're the ones paying you and they're the ones who will dictate what they want, in detail. If they don't get what they want, you don't get paid, so make sure THEY know what they want.
Really, this is a question that you should NEVER have to ask in a forum.
|
|
|
|
|
I agree completely with the other responses - you need to gather requirements from your users to know what to build.
A restaurant and a hotel are really completely different businesses. The restaurant may include both what you think of as "point of sale" as well as kitchen systems - printers and screens, mostly - to facilitate the preparation of the food. The hotel presumably needs to be able to deal with reservations, credit card pre-approval, and incidental charges (movies, meals, crap from the little store most hotels have).
There are probably existing hotel systems that include modules for running in-house restaurants, but I would think that the only real integration point would be managing to bill meals back to the guest's room.
The bottom line is that you need to gather detailed requirements for what they want, and you need to understand WHY they're hiring someone to write a system when there are no doubt quite mature systems available for purchase. What do they think is unique about their operation?
If you're a general consultant as opposed to a coder for hire, the right thing for you to do is probably find an existing package that meets their needs, and try to get a fee from them or the vendor for helping the two of them get it going.
If you're going forward with writing something once you have requirements, you should be looking at Microsoft's Point Of Sale for .Net. It's a .Net implementation of the OPOS standard to make dealing with the specialized POS hardware easier.
Point of Sale is its own unique little niche market, and if you're not generally familiar with it (and you're clearly not) you may want to just steer clear.
|
|
|
|
|
You really have to learn basics. "thermal printer" is nothing important for the project.
Learn some programming and design, e.g. with the book "Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development" by Craig Larman. An example used in that book is a POS, too.
|
|
|
|
|
|
|
You are really struggling with these basic concepts aren't you. Get a book and work through ALL the examples it will be ultimately quicker that repeatedly asking the same questions in a support forum. As answered the other day.
object oResult = (cmd_BranchExposureFactor.ExecuteScalar();
Now you can look at the content of oResult in your debugger to give you an idea what it contains. As Garth said it is probably a string, empy or null. Now you can deal with it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
can we use both two method of connection string in web.config file
1.appsetting
2.connection string?
|
|
|
|
|
Yes. Ultimately it's just a string. The application provides the context.
|
|
|
|
|
You can use below code to get both value.
AppSettings["KeyName"].ToString();
ConfigurationManager.ConnectionStrings["connectionName"].ConnectionString;
|
|
|
|
|
|
I have html page and i want get data from it like we get it from data set.means on basis of some valus i want perticular result.
is possible to fileter it.
i know how to read it but i don't know how get row by row data. or some pertocular data, doing it throgh is realy tough .
i want to know if any other way is there.
|
|
|
|
|
It will be easier to research [^] existing result to the common question.
Never underestimate the power of human stupidity
RAH
|
|
|
|