Announcement

Collapse
No announcement yet.

Tips&Tricks in AVS

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    3D transformation is:
    Xp=Xc/Zc;
    Yp=Yc/Zc;
    where Xc (x-coordinate) and Yc are any numbers, positive or negative, and Zc is positive.
    For a 3D object centered at the origin (0,0,0), use this formula:
    Xp=Xc/(Zc+sqrt(mD));
    Yp=Yc/(Zc+sqrt(mD));
    where mD (maximum distance) is the largest distance from the origin to a point on the object.

    Rotation around any point, line, plane, solid, etc:
    Ar=Ac*sin(theta)+Bc*cos(theta);
    Br=Ac*cos(theta)-Bc*sin(theta);
    where A and B are the axes defining the plane perpendicular to the axial point/line/plane/solid etc. To find the perpendicular plane, simply use the 2 axes you do not use to define the axial object.
    "guilt is the cause of more disauders
    than history's most obscene marorders" --E. E. Cummings

    Comment


    • #17
      Quote:
      Rotation around any point, line, plane, solid, etc:
      Ar=Ac*sin(theta)+Bc*cos(theta);
      Br=Ac*cos(theta)-Bc*sin(theta);
      where A and B are the axes defining the plane perpendicular to the
      axial point/line/plane/solid etc. To find the perpendicular plane,
      simply use the 2 axes you do not use to define the axial object.


      Another way to do this(slower way) is:
      d=sqrt(Ac*Ac+Bc*Bc);r=atan2(Ac,Bc)+theta;
      Ar=sin(r)*d;Br=cos(r)*d;

      Comment


      • #18
        It's a whole lot slower, and it's much easier on AVS to use the rotation matrix
        "guilt is the cause of more disauders
        than history's most obscene marorders" --E. E. Cummings

        Comment


        • #19
          That and you can optimise the rotation matrix if your not using it for a parameterisation or something else where the rotations change for every point.
          -- Jheriko

          'Everything around us can be represented and understood through numbers'

          Comment


          • #20
            I have a kind of a problem, I have used a static background/texture for a movement with bunch of effects. I have made it by putting all the effects inside a effectlist with ignore/replace and on beat active 1 frame. Then i have used a custom bpm set to 30bpm and put both of them inside another effect list with ignore/replace. It now takes about 1-3 seconds to start, but the fps is much higher since it doesn't have to render the texture all the time. This solution works fine, but what im asking is: Is there a even better way doing this? If you use avs effects to create a static background is there a way to only "render" it once? Or how i activate it right at the begin of a song?

            Hope you understand
            Texer Resources

            Im retarded... err i mean retired!
            Probably both...

            Comment


            • #21
              Tuggummi: I think there isnt any better way. I had the same problem some time ago and only thing I learned is how limited effect custom bmp is. Atero posted something at the whishlist about a user defined custom bmp so we can only wait for the next avs.

              Comment


              • #22
                You could just use Custom BPM and set it to skip as many beats as possible, then set First Skip to 1.
                "guilt is the cause of more disauders
                than history's most obscene marorders" --E. E. Cummings

                Comment


                • #23
                  3D SSC

                  Here is a wonderful guide to AVS written by El-vis that was posted a while ago. It gives code to create a superscope in 3D, rotate in along and move it along the x, y, and z axis (what's the spelling for the plural of axis?)
                  Attached Files
                  powered by C₈H₁₀N₄O₂

                  Comment


                  • #24
                    I think it's 'axes'.

                    Comment


                    • #25
                      A better 3D code system:

                      init: zs=sqrt(... *)

                      frame:
                      rx=rx+drx; ry=ry+dry; rz=rz+drz; cx=cos(x); sx=sin(x); cy=cos(y); sy=sin(y); cz=cos(z); sz=sin(z);

                      pixel:
                      ... *
                      x2=x1*sz+y1*cz; y2=x1*cz-y1*sz;
                      x3=x2*sy+z1*cy; z2=x2*cy-z1*sy;
                      y3=y2*sx+z2*cx; z3=1/(y2*cx-z2*sx+zs);
                      x=x3*z3; y=y3*z3;

                      * This should be the maximum distance from the center to a point on your scope, multiplied by 2. For a unit sphere, use the radius of the sphere multiplied by 2.

                      ** x1, y1, and z1 are the coordinates for your shape, and should be put here.

                      rx, ry, and rz are the angles of rotation around the x, y, and z axes, respectively. These angles are in radians (one radian = 180/pi degrees)
                      A good place to define these values is in the beat section of the scope, e.g.:
                      rx=rand(100)/1000-0.05; ry=rand(100)/1000-0.05; rz=rand(100)/1000-0.05;
                      "guilt is the cause of more disauders
                      than history's most obscene marorders" --E. E. Cummings

                      Comment


                      • #26
                        Don't kill me for this, but you're just pathetic. You're stressing your head dozens of priceless minutes. And for what ?! For saving about 0.0001 fps with using a different method !?
                        Don't get me wrong. I'm sure that these tips comes in handy for n00bs and if there's alot to be optimized, but these tips.... It's like thinking how could you put the wires to your electric toothbrush from car, so that you could recharge the battery with it, so it wouldn't see in electric bill...

                        Comment


                        • #27
                          Dear Degnic...

                          1) Are you talking to everyone who has replied to this forum or to one person and if, who?

                          2) The faster the presets run the more enjoyable they are, besides it's more than just 0.<insert ridiculous large ammount of zeros>1 frames, example the gradients work a lot faster when you use different methods. And the static texture for a 3D movement or likes saves up huge ammount of fps if it is only rendered once per N beats. I made a preset with the static texture and the framerate difference between render-per-N-beat and render-all-the-time is incredibly huge, on my 266mhz pentium it was about 8 fps.

                          3) Everything & Anything can & should be optimized. Or do you draw a static single colored ssc line with 800 numpoints when just 2 will do?

                          4) Last, but not least, this thread was about people sharing their ways of doing things. Someone have might used some method for months/years never knowing that it could be done better&faster.

                          If you don't like people giving you helpful advice, buzz off. But by the looks, you are the one who should seriously learn how to do things faster.

                          Have a nice day.
                          Texer Resources

                          Im retarded... err i mean retired!
                          Probably both...

                          Comment


                          • #28
                            I've done #3.

                            It almost got out, then Unconed saw it and I fived it.

                            It sped up the preset a lot.
                            Stoke me a clipper. I'll be back for Christmas.

                            - Arnold Rimmer
                            Red Dwarf

                            Comment


                            • #29
                              This is a trick that can save more than 100% fps.
                              When you need more sinchronised scopes shaped the same you can make a counter and copy this scope to several locations.
                              Example:

                              init:
                              n=500

                              frame:
                              t=t-0.05;u=0;

                              point:
                              u=u+1;u1=u%5;
                              d=i/5;r=t+i*3.14159*4;x=cos(r)*d;y=sin(r)*d+(u1+0.5)/5*2-1;

                              This will create 1 spiral scope and place it at u1/5*2-1 locations, u is a counter and equals the value of a point, u1 equals:
                              0 for u being 5,10,15,20,...
                              1 for u being 6,11,16,21,...
                              2 for u being 7,12,...
                              3 for u being 8,13,...
                              4 for u being 9,14,...

                              For a more complex use of this see the attachment. The preset calculates the whole 3D rotation thing, music responce and scope shape only once for all of the cn(6) columns.

                              Sorry for the shity explenation but i find it hard to express myself in english.
                              Attached Files

                              Comment


                              • #30
                                My (and most everyone who doesn't depend on El-Vis's engine) 3D code is several FPS faster than El-Vis's, and it's a whole lot more user friendly. Also, for those who didn't know: using zs=sqrt(maxdistance) projects the object so it is always inside the window. To find the maximum distance from the center of any object to a point on the object, use this method: For any variables (e.g. i and v), assume they are as high as they can go (e.g. i=1, v=1). Then simplify all your calculations. For example:
                                (tpi=acos(-1)*2=2*pi)

                                r=i*tpi;
                                x1=sin(r); y1=cos(r); z1=v/4;

                                r=1*tpi=tpi;
                                x1=sin(tpi)=0; y1=cos(tpi)=1; z1=1/4=0.25;

                                Now, find maxdistance like this:
                                sqrt(x1*x1+y1*y1+z1*z1)=sqrt(0*0+1*1+0.25*0.25)=sqrt(1.125)

                                So for the example scope, zs should equal sqrt(sqrt(1.125)*2)=pow(4.5,0.25).

                                If you want the scope to be slightly inside the frame, use a higher zs. If you want it to be slightly outside the frame, use a lower zs.
                                "guilt is the cause of more disauders
                                than history's most obscene marorders" --E. E. Cummings

                                Comment

                                Working...
                                X