Jump to content

jed

Limited Member
  • Posts

    2,189
  • Joined

  • Last visited

  • Days Won

    66

Everything posted by jed

  1. @SolarPH sorry, but I think I'm wasting your time. Can't make any sense about what you are trying to do. Good luck anyway.
  2. You are thinking of the compare node - condition routes the inputs to the output, selected by switch ( < Mr Pedantic ). I had a look at the C4D file - it's a whole bunch of renamed operators and nested X groups with no description of what it's supposed to do, and not even 1 remark node. I'm an XPresso user, but the chances of me reverse engineering that code, working out what its function is and fixing it is zero. Maybe @SolarPH could post a simple file with just a few nodes explaining the problem eg I have inputs A, B, C and I need output D. Screenshots don't show data types. Color in XP can be tricky at the best of times - RGB, HSV, 360 deg, 255, % meaning decimal etc, although most things can be resolved with colorspace and vector2reals.
  3. Might be easiest to edit the audio with something like the free Audacity . Here's a snip using the envelope tool - manual here Windows and Mac also has a compressor, which can smooth things out [don't know if it's my computer, but the 1st part of your question seems to be in invisible black font]
  4. Looks like you have parallel movement checked
  5. TBH I wasn't exactly sure what a spline segment was - had to ask an expert here. I'd always assumed that if you had a regular spline with 4 points, then the 3 bits between the points were called segments. Apparently I was wrong - a single spline object that consists of multiple splines (like text) has segments. filed under 'learn something every day'
  6. AFAIK you can't access individual clone size, although there is a workaround - and it's a bit of a fudge. If you make the cloner ghost dynamic (doesn't actually fall with gravity), you can use dynamic nodes eg body state to get to each clone. For some reason the XPresso tag has to go on the cloner, and being dynamic the timeline has to be advanced a few frames for the math to work. See snip - If it's just for setup purposes, you could go to F5 and make the cloner editable, then the sizes would stick. https://www.dropbox.com/s/2wi21g9zyxl7ni6/clonespline.c4d?dl=1 If it was just iterating cylinders on stuff, and doing some math - that would be easy. I was going to say credit, but maybe the word is blame, to member Teknow for the above ghost dynamic fix.
  7. jed

    Fast and Furious

    How about a plug for Gilles Tran, who made the free Creative Commons License Mini http://www.oyonale.com/modeles.php?lang=en&page=58 my favorite car
  8. jed

    Fast and Furious

    I used Python for keyframing friction with align to spline position as parameter def main(): global rw_friction if position > 0.17 and position < 0.3: # 1st drift align position start/end rw_friction = lo_friction elif position > 0.45 and position < 0.53: # 2nd drift rw_friction = lo_friction elif position > 0.67 and position < 0.82: # 3rd drift rw_friction = lo_friction else: rw_friction = hi_friction # if not in drift zone, use normal friction sledgehammer nut style
  9. jed

    Fast and Furious

    The angular damping is set crazy high - 99% IIRC.
  10. This might amuse someone. I've been chatting to member Tans who wanted to make a dynamic car drift. Must be hard IRL because I found it impossible in Cinema. However, I came up with one idea - to ditch the motors and drag the dynamic car with a spring on a spline. Then you just got to keyframe the rear wheel friction on the corners. The front wheels point at an object a bit ahead on the spline, so it looks like it's steering. I had trouble posting this earlier, so apologies if it appears twice
  11. There's a bit of crossposting going on here. This is the last file I uploaded https://www.dropbox.com/s/b0e1x6idxowjz5n/fixedcar2.c4d?dl=1 I made the car 4.5m long (like say a Corvette), and changed the custom center to X -31cm (mid wheelbase) and Y -55cm (to stop flipping when cornering fast). The car drives OK so what's next ? I'm not sure what the last file in the last post is all about. Are you trying to steer using hinges and dynamic wheels - because that won't work. You can't move rigid bodies with XPresso when the animation has started. Use wheel suspension - not hinges and XPresso. And what is the spring supposed to do ? ( < rhetorical question ).
  12. Sorry - I made an error with the fixed car. Will upload another version shortly. I think I scaled the car too large - I'm used to seeing cars in Z direction, so was looking at wrong axis. BRB. try this one https://www.dropbox.com/s/b0e1x6idxowjz5n/fixedcar2.c4d?dl=1
  13. I'm not sure which file is which, but I fixed the car you first uploaded. I put the motors etc inside the car and scaled it up to real car size ie about 3m. C4D car stuff works better with lifelike car sizes. I lowered the center of gravity (custom center) so car doesn't roll on corners. I put the suspension different front/back because the car's heavier at the back. Your wheels are too round - no surface area for friction. If you need the tyres that shape, use hidden proxy dynamic wheels with the visible ones as children. Anyhow, the car now drives. Moral of the story - put motors etc where they are in real cars. When did you last see a car with an engine inside each wheel ? Cinema does its best to imitate real physics, so should you. https://www.dropbox.com/s/clwmzo7ratye1fz/fixedcar.c4d?dl=1
  14. It's always a good idea to post your 'problem' files here for people to have a look at. There's a Cafe size limit, but you can leave out images etc to keep the filesize down. Also C4D files compress quite a lot with WinZip. Failing that, use DropBox or similar. I've tried in the past to get dynamic cars to drift, eg by keyframing friction for less grip at certain points, but have never had much success. Although C4D dynamic cars are a lot of fun, sometimes you've got to animate with keyframes, splines etc to get what you want. There's XPresso methods to rotate (non dynamic) car wheels correctly - driven by car position - so you just move the car on a spline and the wheels turn realistically.
  15. Some of my Minis having a race
  16. You seem to have the motors and suspension as children of the wheels. In a real car the motors and suspension are in the car body, and should also be in your scene. See zip file for 3 examples of how I rig cars. There's a car with manual steer and a car that follows an object (so has auto steer). These are just made from cubes etc. See the Mini car for how I rig a real car model. I don't make the actual model dynamic, but use primitive cubes, cylinders and put the dynamic tags on these. The hi-polygon model parts are children of the simple car. This makes the car drive better. The Mini file has a view switch so you can see the dynamic car underneath the real one. https://www.dropbox.com/s/lxmc6fhzwu2mbl7/3cars.zip?dl=1
  17. I see it now - if time == previous, do not add to rotation (when clicking in viewport) if time < previous, subtract from rotation if time > previous, add to rotation took me a while to work out when time < previous == true > scrub the timeline - D'OH ! as Homer would say did @Gregor get his flipboard sorted ?
  18. Not sure what you mean by this. I had a look at the file from CG, and although it does turn I haven't got the time to analyse his math, so I can't really comment on his work. One thing that really frustrates me is when folk post an XPresso solution without an explanation. I know it's difficult to guess the ability of the person reading a comment and to pitch an explanation at the right level, but too many remark boxes is better than none at all. I put comments on my own XP and Python, to jog my memory when reusing stuff 6 months down the line - I'm sure you do. This thread has been hijacked . . .
  19. When generating rotation by a simple multiplication, say frames A and a multiplication factor of B (for degrees), the total rotation at any frame is rotation angle = A * B degrees (could be using time secs, but it's the same math) If B is constant, the total rotation increases linear with time (frames) ie at a constant speed. Say you were at 50 frames (A) with multiplication factor (B) of 10 degrees, the total rotation is A * B = 50 * 10 = 500 degrees at F51 A * B = 51 * 10 = 510 deg etc But if at F50, you try to slow down the rotation speed by dropping B to 9 degrees (B keyframed 10 at F50 and 9 at F51), the total rotation at F51 is A * B = 51 * 9 = 459 degrees so the object has gone backwards ! (this is your glitch) whereas my method of adding a smaller value in that frame, still goes forward. If I was generating rotation by adding 10 degrees per frame, the rotation is angle at F50 = 500 degrees then I lower the speed to 9 angle at F51 = 509 degrees angle at F52 = 518 degrees > still going forward, but slower Simplifying this using linear speed - if an object is at 100m and after 1 sec it is at 105m, its speed is 5 m/s ie 5 is the change in the existing value in one second. When the object is at 200m, 1 sec later (if still going at the same speed) it will be at 205m. The speed is the change per unit of time - the distance increases by the same amount ie 5m in 1s. With my 'addition method' of generating rotation speed, the time unit is 1F and I'm adding a set value every time unit - 1F or 1/30 sec. If I want to vary the speed by changing the amount added per frame, I'm adding to the existing rotation. If I add a smaller amount, the object goes a bit slower - not backwards. If I add the same amount every frame, it has constant speed, if I add a larger value every frame it goes faster. If I add zero - it stops. TLDR version > speed is the rate of change per unit of time. edit : see demo of linear speed by addition https://www.dropbox.com/s/7znmbmo7c0zu0y7/demospeed.c4d?dl=1
  20. Maybe not relevant to the flip display issue, but here's a little trick of mine to get varying rotation speed without glitches. Using time + multiply is fine for constant speed, but if you generate rotation by adding a small amount every frame, you can change the amount added and get smooth speed changes. There's a rotation reset @ F0, otherwise the rotation value persists. Also, since this is an addition, any viewport activity (moving stuff or just clicking) when F > 0 will cause the XP to recalculate and rotate the object 1 step - but realigns when timeline is rewound to F0. I used radians in the XPresso to save unnecessary degree conversion. https://www.dropbox.com/s/bx6ibid34colx2x/addrotate.c4d?dl=1 method works well with helicopter rotors if amount added keyframed https://www.dropbox.com/s/azjzi3lnr7f794q/chopper.c4d?dl=1
  21. jed

    Trouble calculating angle

    The problem is that you don't understand trig and how the sin function is symmetrical around 90 deg eg sin(30) = sin(150) = 0.5 in fact, there's a lot more than 2 solutions to x = asin(0.5) eg . . .-690, -570, -330, -210, 30, 150, 390, 510, 750 . . . etc try it on your calculator The only way you can differentiate asin(0.5) to be either 30 or 150 deg (or whatever) is to do a bit more math. You don't say how you are calculating the hypotenuse, but in this file I've just used a distance node. It's in side view so the angle you want is positive in correct direction. There's a condition node to detect when to make the angle > 90 and when not to. https://www.dropbox.com/s/elbcn3e7vk74alj/trig.c4d?dl=1 you could also use a target tag pointing at the upper point, and measure the angle
  22. You mean you want the conveyor belt to move - stop - move - stop etc ? Try this file - another monoflop LOL https://www.dropbox.com/s/wlnbfs49m4tzaxc/convbelt.c4d?dl=1
  23. You'll have to get your calculator out - if the range mapper covers say 50F in time, the rotation starts at 20F and you need an event to occur at 30F, then the RM point needs to be at ( 30 - 20 )/ 50 or 0.2 on horizontal axis. I guess this could all be done in the timeline, using one of the repeat functions to scale it up. I tend to see every C4D problem as requiring an XPresso or Python solution. When all you've got is a hammer, everything looks like a nail . . .
  24. jed

    Trouble calculating angle

    I'm not sure where you got that big complex equation from, but you should just use the 3 equations in that pic I posted - separately. If I'm reading this correctly, you only have x and y positions of the lower and upper points (assuming front view). If you don't need the actual length of the hypotenuse, just use arc tan to get the angle. tan(a) = opposite / adjacent you can get the angle by deriving opposite and adjacent from the x, y positions of upper and lower points using arctan (You may need a negate node, due to which direction is considered positive rotation) I've used a degree node here to convert rad to deg for your benefit. I only use radians in XPresso - in fact XPresso only uses radians. This could be why you are getting incorrect angles ie from unnecessary conversions. The 360 degree malarkey is just for everyday convenience. The number 360 divides by 2, 3, 4, 5, 6 . . . etc, so it's handy when designing clock faces etc. The C4D GUI uses degrees to make it easier for non-math folk to understand, but whenever you type in degrees eg in a rangemapper, or for rotation, XPresso converts it to radians to do the math. This catches people out when they hang a result node on a port in XPresso and see 'wrong' values. A radian is the angle at the center of a circle when the arc length = the radius since the circumference of a circle is 2 * pi * R, the angle for a complete circle is 2 * pi radians 360 degree = 2 * pi radians, if you really must convert Radians is the usual unit in physics + math - a right angle is often referred to as 'pi by 2' etc. TLDR > use radians
  25. @cavolfiore I guess you're referring to the modulo divide as in this snip what's going on here is that the modulo counts the frames up to the constant value 150F, then resets to 0, then does it again and again. If you divide the modulo output by the actual modulo number (150 in this case) it gives a value that represents how far along the count you are. So if the modulo output is 75, then 75/150 gives 0.5 because it's at 50% of the modulo counting sequence. The output of the divide node is a decimal number 0 >> 1 showing the position in the count. If you were to plot the divide output against time, it would look like this where the min value is 0 and the max is 1. In fact that's how I generated that oscilloscope type trace (for a different project). This modulo + divide is a handy little trick I use a lot in XPresso, often coupled with a rangemapper. You can think of the modulo function as the remainder after dividing number A by number B. We are not concerned with how many times B goes into A, just the remainder (which is the modulo) eg A = 12 B = 10 B goes into A once (this doesn't concern us) with remainder 2, so the modulo is 2. Carrying on - A = 65 B = 10 B goes into A 6 times (doesn't concern us) with remainder 5, so the modulo is 5 in Python, for example, the symbol for modulo is percent %, so this would be written 12 % 10 = 2 65 % 10 = 5 etc . . . HTH
×
×
  • Create New...

Copyright Core 4D © 2024 Powered by Invision Community