QuaziGNRLnose's Forum Posts

  • bezier curves do this nicely

    simply set position to

    X= cubic(p0.x,p1.x,p2.x,p3.x,variable('t'))

    Y= cubic(p0.y,p1.y,p2.y,p3.y,variable('t'))

    the p#'s are sprites which define the paths points. p0 would be the point the path starts at, p3 would be the one it ends at. the other 2 control the curvature of the path like so

    <img src="http://upload.wikimedia.org/wikipedia/commons/f/ff/Bezier_3_big.gif">

    as you can see t is a value which when changed moves the paths returned position along. it should be a number from 0 to 1. 0 meaning its at the complete beginning of the path, 1 meaning its at the absolute end. 0.5 would mean the center. imagine if you multiplied the number by 100 it would be the percent moved along the path. so 0.25 would be 25% and so on.

    if you would like to move your object back and forth along the path at a certain speed simply add a small number like 0.01 to the t value. so it will take 100 frames to move it from p0 to point p3.

    a value less than 0 or greater than 1 will simply move the object to a position that would exist if the curve were to continue at its current amount of deviation

  • This is me!

    my only theory is that she is in fact, an android.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • i can say that certainly my way of doing it would be alot less of a draw for something with 20 points than you're method, and controlling higher order bezier curves gets counter intuitive. theres no plain and simple way to make large amounts of point into a smooth curved line.

    using my method the transition between them would be perfect, as long as youre drawing events did 0.0-1.0 for the t value of the beziers, and the points were all on integer positions (round(x),round(y)).

    when drawing a bezier as a full line (im assuming youre not simply wanting to get a points position based on an expression, but rather drawing a line like in my picture), u need to use loops, and for it to be smooth u need to use a large amount of loops. for a 20 point spline, made of cubics, running a loop 100 times to draw each of the 5 cubic beziers which make up the 20 point spline, youd need to run a cubic expression a total of 500 times, (1000 if you count that youre doing it for x and y, and 2000 if you count that youre doing it for x and y, and drawing a line from the point drawn before to the current one). if you were using a single bezier of 20 points, youd need to run an expression that would probably be too long to even list in the length of this entire thread, 2000 times.

    it takes alot of power to do this stuff. e.g. truetype font was chosen over type 1 simply because it used quarp to define curves instead of cubic.

    i understand you feel adding lerp^n would be a good idea, but when you actually look at different order beziers in plain algebra instead of 5 letter things you can easily write, you realize how much more expensive and complicated they get from one iteration to the next.

    lerp is simply " a+(b-a)*t "

    qarp is " ((a+(b-a)*t)+((b+(c-b)*t)-(a+(b-a)*t))*t) "

    cubic is " ((a+(b-a)*t)+((b+(c-b)*t)-(a+(b-a)*t))*t)+(((b+(c-b)*t)+((c+(d-c)*t)-(b+(c-b)*t))*t)-((a+(b-a)*t)+((b+(c-b)*t)-(a+(b-a)*t))*t))*t "

    and so forth.

    a generalization is every bezier is made up of the bezier type before it for each of the n points as the 3 values inside of a lerp.

    qarp is really just lerp(smaller)+(lerp(bigger)-lerp(smaller))*t

    cubic is really just qarp(smaller)+(qarp(bigger)-qarp(smaller))*t

    they grow fractally is the best way i find to describe it larger parts made of smaller parts repeating until made up to their simplest form.

    for a n point curve things would get really, really long. qarp, a 4 point curve is all ready pretty big, 5 would be 3 times as big, 6, 9 times and so forth for 3^n or wtv.

  • if you want corner less smoothly transitioning curved lines, you can combine quadratics, or cubics, but you must make sure that the handles (point 2 and 3 in a cubic, point 2 in a quadratic) have opposite angles from their follow up in the next bezier set. so lets say we had 8 points which were joined into a line (you could even do a closed shape if you wanted) using 2 cubic beziers. points 1-4 were a set, and point 5-8 were another set. the angle that point 3 was relative to point 4 would need to be the opposite (simply +180 to the value) for point 6 relative to point 5, also obviously points 4 and 5 would need to share the same position so make a seamless curve. a picture would better explain things so...

    <img src="http://dl.getdropbox.com/u/1010927/spline%20tut.png">

  • small screens give me a headache. id say DS since iphone seems to have mostly crap and even things you think would be amazing got terrible reviews (monkeyball)

  • i can be arsed to read the entire wall of text that this thread is, but from skimming im pretty sure youve misunderstood what you yourself are trying to do

    [quote:8gkw087h]Options: Set Y to lerp(.Y, Options.Y+16, 1 - 0.00001 ^ TimeDelta)

    this equation doesnt need lerp, infact i have no idea why your using it. all its doing is setting the y position of watever.y, to a position somewhere in between its current y position and options y position +16. the value your using as the "t" value makes no sense. its a number that is never changing except for what time delta is so in short, your lerp targets are always moving, so your objects will continually move. (is options moving aswell?) what you should be doing is storing the initial y position for each object in a variable, called intY, and then the point which you wish it to get to (options.y + 16?) in another value like tgtY DO NOT CONTINUALLY UPDATE THESE, THEY ONLY NEED TO BE SET ONCE, LIKE AT START OF LAYOUT. then u use those two variable for each objects lerp coordinates, and then a third one for the t value so something like lerp('intY','tgtY','t')

    u modify t in actions completely unrelated, by adding or subtracting small increments (0.01) from it until it reaches 1 or 0, then u stop.

    you wont have to do all this for each object because you could put each one in a family with all these variables, and only control them when those object meet current conditions.

    if you want the movement to smoothly accelerate and then smoothly decelerate, you "cosp" inplace of "lerp"

  • i was kinda bored and playing the game hammerfight led me into wanting to make a physics based 2d cloth/banner wtv.

    well id say that i succeeded. although the collisions need a bit of work because physics has no "point" based collision (feature request) the cloth just collides 6 pixels away from what its actually hitting (its a 13x13 circle)

    the cap is made in 98.9 so im unsure how well it might work in newer versions. i bundled an exe just in case.

    mouse controls the cloth "pin"

    holding space shows the nodes and springs.

    http://files.getdropbox.com/u/1010927/Cloth.zip

    oh yah i went a lil overboard trying to make it bloom-ish with layer effects so you might wanna take those out if its slowing things down. i think it would look excelent for curtains blowing in from an open window during a sunburst afternoon, or a cape for some character, feel free to use it

  • she looks prepared for battle, a cold one though.

  • <img src="http://keepittrill.com/media/wp-content/uploads/2009/05/swine-soulja.jpg">

    ~Sol

  • you could just do that with layer effects

  • this is indeed very cool, but its not really a substitute for a full fledged "camera" object because it doesn't take into account things like parallax and 3d effects (box, distortion) which are based on the scroll position of an INDIVIDUAL viewpoint. these things would have to be re rendered for each camera.

    of course with lucid s method you could solve this by moving the scroll to that position, pasting everything, ect for each viewpoint, but i dont think paralax and 3d things can be pasted properly (besides 3dbox) and im not sure the effects like that would update before frame drawing in the event phase. meaning things would be alot more complicated than simply having a nice object to do it for you, which is kinda what construct is supposed to be about, elegance and simplicity in game creation. so that you don't need to always fumble around and do multiple steps for things which should only take 1. another thing which would be cool to have in a camera object is for it to be able to rotate and move along XYZ, but that might be asking too much

  • <img src="http://www.slashgamer.com/wp-content/uploads/2008/11/obama.jpg">

  • <img src="http://upload.wikimedia.org/wikipedia/commons/d/d8/Jpg_pixel_cube_2x.jpg">

    JPG

    <img src="http://upload.wikimedia.org/wikipedia/commons/e/e6/Png_pixel_cube.png">

    PNG + it has alpha support

  • i remember this was one of my very first requests when i joined here.

    it was possible using the viewport extension from mmf2, still waiting on the construct version of that object after a year lol

  • you wouldn't only use that type of object panel obviously

    youd use tiled bg for main filler, and panel textures with "open ends" ie the last shape in my example graphic

    it would be much faster and more intuitive then always moving corner pieces, top pieces ect.