noobnerd

Members
  • Content count

    28
  • Joined

  • Last visited

Community Reputation

128 Neutral

About noobnerd

  • Rank
    Member
  1. physics help

    sorry, i will clarify:   from newton, F = ma -> F = m*dv/dt  Fu = u*N                                                                            force of friction = coefficient of friction times normal force Fu = u*m*g*(r?)                                                               cant say i see why the r is there now that i think of it i got this from here where it says so but cant see why? maybe this explains it. with my radius of 0.02857 it would cause quite the difference at least.   Fu x R = torque caused by the friction force T = I*a                                                                                 Torque = moment of inertia times angular accelleration T = I*dw/dt                                      dw = T*dt/I   moment of inertia for a sphere is (2/5)*mass*radius^2   thank you for your time
  2. physics help

    hi there. I have been working on a pool simulator in DarkBasic for a while now and it doesnt work correctly. And i cant see why.    so the problem is that when sliding on the table the balls angular velocity doesnt change as fast as it does in real life ( i have a pool table available so i have checked it over and over. (i also found some highspeed videos online which confirm the error)    I use the following to calculate the motion of the ball on the table:   where  V = vector for velocity of ball W = vector for angular velocity of ball P = vector for position of ball Vt = vector for perimeter velocity at contact point ( with table) r = radius of ball R = vector from center of ball to the table ( length r) m = mass ( 0.16 kg ) g = acceleration due gravity ( 9.81) us = coefficient of friction while slipping (0.2) ( have tried all kinds of values) ur = coefficient of friction while rolling (0.01) x is cross product d is delta dt = time-step of the simulation ( on the order of 5x10^-5 )   Vt = (R x W) + V if Vt = 0 then the ball is rolling without any slip dV = -us*g*dt*(Vt/|Vt|)                                 (Vt/|Vt|) is the unit vector in direction Vt V = V+dV dW = [(-us*m*g*r*(Vt/|Vt|)]x R) * (5*dt)/(2*m*r^2) W = W+dW if the ball is rolling:     V = V-(ur*g*dt)*(Vt/|Vt|) endif Wz = Wz*(1-uz*dt)               where Wz is the z(perpendicular to table) component of the angular velocity and uz is a friction to slow it down ( nothing in the "real" physics would stop pure z spin)   this seems to produce approximately 10-15 times too weak dW. Why is this?   any help very much appreciated           
  3. sphere vectors 2D to 3D

    thank you for they quick answer it worked perfectly. 
  4. sphere vectors 2D to 3D

    hi everyone and thanks for helping me with the questions ive asked so far.   I have encountered yet another problem in my billiards (pool) game, when trying to do a kind of selector which allows you to select where on the ball you want to hit.   I want to have a circle which symbolizes the side of the cue ball facing you. you can then click anywhere on the surface of the circle to select the spot you want to hit. now to calculate the change in agular velocity i need the vector (3D) that goes from the center of the ball to the point which i just selected. That is a radius to the surface of the ball. considering that the ball is "pointing" in the direction that you are going to shoot it means that if you select the precise center of the ball you are going to get the vector  -F/|F| r   that is the vector in the vector in the opposite direction of the shot that has length r which is the radius.   can anyone help me with this? if my formluation was confusing i will try to draw it somehow.   cheers    
  5. shadow on plane

    Hi im trying to work out how to get the "shadow" of a sphere which is positioned on a plane. The light is a point somewhere above the sphere. The shadow will be a cone/plane intersection that is a ellipse or maybe a parabola/hyperbola in weird cases. what i would like is the 2 radii for the ellipse and the points where the ellipse "starts" and "ends" so i might stretch a pre made "shadow" image to the right size and just place it there. Has anyone encountered this before? thank you for your time [sharedmedia=core:attachments:12865]
  6. billiard/pool balls

    thank you H4tt3n. I have read your links and they were indeed helpfull, especially nr 2 wich covered the issue i asked. thank you!
  7. billiard/pool balls

    Hi I am doing a pool simulator (billiard) and have found a problem im not sure of how it works in real life. When 2 balls collide they impart rotation onto each other ( this i have tested my self and found true ) but im confused as to how much? i can work out the tangential velocities of the balls at the point they collide and this i guess combined with some coefficient of friction would do the trick, but is this how it works? is friction dependant on velocity? sorry if confusingly explained and for the english.
  8. self advection

    Hi there. I have been trying to do a fluid simulator using vector fields, just toying around with ideas not trying to follow something already invented and smart like SPH or the likes. I have got seriously stuck now when trying to self advect velocity fields, that is make a velocity field move itself ( evolve maybe) i have googled the matter and found many promising guides ([url="http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf"]link[/url]) and tutorials but they all seem to expect that i would be familiar with math i am not familiar with. I'm not asking for some magic easy solution, what i would like is for someone to tell me what the mathematical principles are that i would need to understand prior to trying this. i understand vector fields and operations on the on a rudimentary level (curl,div,grad) but self advection eludes me. any answers or links to helpfull articles would be much appreciated
  9. lines

    Thanks for the quick replies. @ Telastyn : I know, but i just think that doing programs that you are interseted in is a good way to learn the language, instead of just doing endless examples of different method attributes etc. that just show you what it does. Of course this would only help me get comfy with C# basics as it is not like i would ever come up with something like abstracts or such except by reading it in the book. System.Drawing, okay thanks, but how do i use them, i cant just draw a line in the console. Are they used on windows forms? @Nypyren : Thanks! will try it out @Iride : Yeah, thats why i moved to C# from Basic.
  10. lines

    Hi there I have been reading a book on C# for a while now and i think im beginning to have a somewhat rudimentary understanding of how it works, but so far the only things i have learned are console applications and different ways of making fancy methods and stuff. Before C# i learned Dark Basic mainly by trial and error by doing small graphics programs that looked cool. So to the point. How do i do small graphics programs in C#? In Basic there are commands like line(x1,y1,x2,y2,color) and i assume that such stuff doesnt exist in C# so how do i do this? I checked the book and it only tells me how to use C#, not how to actually do things with it that anybody would like to use. Thank you
  11. Getting the outline of a bunch of points

    thank you all for your replies! it will take me a moment to get all of this sorted out and understood. @ruler of nothing : looks interesting and i think i will have a look at it but at the moment i need to get shapes that arent entirely convex. @emergent : looks pretty much like just what i wanted! in my game there is no risk for "orphan" points an if there were they arent important so it just good that it "skips" them, i will probably use the method you proposed but it might take some time to figure it out
  12. Hi there! For a game i am making, I would need to know which points of a bunch of points make up the ''outline". I have about one hundred points of which the xy coordinates are known. And i would need to get the outermost points ids. I could then Draw an outline for the bunch. Any suggestions appreciated. I have tried comparing distances and vectors from a centerpoint but my results have not been satisfactory
  13. Hello! I have been doing a 2D space game for quite a while now and i have stumbled upon a problem. For graphical purposes, i would need huge amounts of asteroid images that are fairly low res ( 256x256 ) but still look quite good and different. also i would need different hues of asteroids for different systems and icy ones etc. I decided i should make an asteroid generator, but i´m not sure where to start? what would be a good way to do such a program? I´m using DarkBasic Pro. It includes a lot of primitive 2D commands ( fillcircle, filltriangle etc ) and supports blendmodes ( additive subtractive etc. ) any advice ?
  14. Advanced motion prediction ( 2D ) help

    and duh, there is another problem. it doesnt take the shooters motion into account. if i set its vector to anything else than 0 then it will always miss. the thing is in my game the bullet will get a vector that is calculated like this: bullet_vector = sin(shipangle)*bullet_velocity,cos(shipangle)*bullet_velocity bullet_vector = bullet_vector + ship_vector i will try to change the formulas to accomodate this
  15. Advanced motion prediction ( 2D ) help

    ok i have an ansvear for you. EVERY location that is "behind" the target will miss. you can picture it like this : if the radius is a line going on a graph from 0,0 to 0,2 the targets direction is negatively along the x axis then every location inside the aproximately 135 degrees between that and a line between 0,0 and 1,-1 will miss. and, the higher the number of iterations the smaller the amount of degrees becomes. @ 25 its like about 110 @ 50 its almost 90 @ 100 its like 10 or somethin and @ 250 there is nothing wrong left. only negative numbers and correct ones