B2.57: How to read the F-curve values with property?

Hi

I’m new with B2.5* series and the F-curve system is pretty unclear to me.

Is it possible in BGE runtime to read the F-curve values so, your using a property to control a keyframe value?

Instead of the animation, I would like to use a F-curves as a analog response curve data storage.

Think application, like a engine rpm vs output horsepower & torque

http://people.arsc.edu/~munk/S4/2.7tGraphBig.gif

I think the answer is yes. I’ve been thinking about how to try it. I’d probably get an image of a curve such as rpm vs horsepower, scale it to fit to the blender grid and set up an orthogonal view. Then I’d manually move an object and keyframe it to trace the shape of the curve, from say 0 to 7000 rpm. So x and z values could be proxies for rpm and horsepower, and the x values could become property values from 0 to 7000. The object you use to create the ipo need never be seen except while you are designing.

It probably wouldn’t be that hard to try out and test. Viewing orthogonally you could run the ipo and have your object add little cubes as it moves and check their position against the background image of your curve.

It might be a pretty dirty way of doing it but could be a fun exercise. Of else there are probably utilities that can graphically examine an image and provide some kind of mathematical equation for it.

If you were replicating a car in blender there’s not much you can do with the information in those curves unless you wanted to simulate performance on a dyno or something like that. Or maybe the S4 displays this information on the dashboard.

So anyway you could replicate the shape of the curve. The controller owner could be anything, make it a vertical red bar with it’s object centre at it’s bottom edge. It’s value, Nm or kW, is analogous to it’s scale. Scale of 1 = 100 kW say. You pass that value onto something else later to rotate a dial or digital display on a text object.

Your f-curve actuator is set to Property and your plane object, the vertical bar, has a property [“rpm”]. That value is determined by the position of an analog stick or pedal or a keypress with a counter. That’s the value you give to the f-curve actuator. So it’s not really dirty at all, no dirtier than looking for mathematical expressions that approximate sections of the curve and stitching them together with a bunch of conditional statements.

You’d want to see how the car performs over a standing kilometer so that you could write a script for your input that determines how quickly the engine will spin up to speed and how fast the vehicle is travelling from moment to moment. It’s the latter that you would really be using to simulate the performance of a particular car.

Hi Equip,

Thank you for your detailed input.

I’m actually after the airplane aerodynamics & flight mechanics application.
See attached example file for the symmetrical airfoil AOA 2 Cl/Cd/Cm values.

I was using the car engine power & torque output as simple example. I’m sorry for my unclear writing.

So,
What I would like to see in BGE, is a some sort of standalone F-curve, which do not need a any actual Blender object. It’s a individually named object itself.

Lets call this new curve type as a data-curve I.E. D-curve from now. The scale of the D-curve is a -1.0 to 1.0.

With the BGE API the user can call a certain named individual D-curve or grouped D-curves with float value and get curve value/s accordingly for return.

Attachments

B257_IPO_test.blend (280 KB)

yo Xjazz. Basically I think what we are talking about is using f-curves where we might otherwise use a mathematical expression. If we’ve got a mathematical expression, like for simple harmonic motion, we would have zPos = k*sin(angle) in a script… no need for an f-curve. But for things where we can’t find a mathematical expression we can draw a curve in the f-curve editor. And I figure there’s a couple of ways of doing that, even like I’ve suggested, bringing the image into blender and measuring it’s values using the scale or position of a simple object. (I thought of this method because I was thinking of actually using the object or some of it’s attributes to either be or to run a dial or something)

But I think I know what you are getting at. It might be nice to have an option of a very simple xy type bezier or point to point curve editor. But then maybe it’s already there in the f-curve editor, it’s just that the f-curve editor often looks overly complex for the simple little thing we wanna do. We don’t like the idea of this terrible tangle polluting our blendfile.

It’s also a little confusing for relative noobs like myself. We’re a bit uneasy I think… we’d like to be able to name and save small simple f-curves like materials… but maybe we’re worrying over nothing. And in the end regardless of whether we might think of curves as being objects we need to apply them to objects using controllers eventually.

Your blend certainly does the job. I’ve been to slack to do my exercise yet. Maybe later today. And I’m still new to the f-curve editor in general.