3D Gauges

Hi!

On our Polish forum trying to create a script that will handle the tachometer indicator. The script engine speed of rotation is very simple, but the problems start when it inclined at an angle. Indicatnor is not behaving like texture without views.ini added. Do you have any ideas on how to bend it correctly because we are over ideas :-P

Skybh used in the Renault Laguna, but just like us indicator are flat.

This is Elektryk`s script:
Code:
rcar $car = get scriptowner car
float $rpm=0

rcarmodel $wskazowka = get generic model 8 of $car
set $wskazowka scriptcontrolled 1

while 1
{
$rpm=get $car rpm
if $rpm > -5
{
set $wskazowka rotation float[3]{0,0,$rpm/2000}
  set $wskazowka position float[3]{0,0,0}
}


  interrupt
}
 
Should just be able to set one of the other rotation angles to a constant if I understand the problem right, eg. float[3]{0, 0.2, $rpm/2000}. I don't know offhand whether that works completely though, not sure what kind of rotation vector the scripts use.
 
Yes, this works, but it gives the same effect as turning the model in ZModeler. Indicator moves all the time axis, and the model is only tilted. We want to turn the axis on which the indicator moves, and not the model itself.
 
Ah yeah, gonna have to do trigonometry then, something like
$anglez = $rpm/2000
$anglex = 0.2 * sin $anglez
$angley = 0.2 * cos $anglez
float[3]{$anglex, $angley, $anglez}

I don't have an object set up to test this though so can't say I have the code written correctly. I remember having trouble with multiple operations per line of code but not sure in what way.


It's a yaw-pitch-roll system afaik so you might be able to look up how to do rotation compositions (ie. first a pitch of 0.2 radians, then a roll of $rpm/2000)
 
Last edited:
Humm i've tried to that do (inclined needles). But since the rotation point of the model should be placed on car's CG.. If you move you cg, the rotation won't stay ok :(
(I hope you understand what i mean)
For exemple just change CG location of car with opening doors, and see the result lol
 

Latest News

What would make you race in our Club events

  • Special events

    Votes: 62 29.7%
  • More leagues

    Votes: 40 19.1%
  • Prizes

    Votes: 43 20.6%
  • Trophies

    Votes: 24 11.5%
  • Forum trophies

    Votes: 13 6.2%
  • Livestreams

    Votes: 32 15.3%
  • Easier access

    Votes: 114 54.5%
  • Other? post your reason

    Votes: 33 15.8%
Back
Top