changing colors

Started by spook1, Sun 14/03/2004 15:04:06

Previous topic - Next topic

spook1

For my teaching game on electricity, i want to create wiring that colors as the surrent through the wires increaes.
low current: blue wires, higher current: red wires and very high current: yellow wires.
I am realizing this by making each wire an object, and a accompanying view.
As the current increaes the view moves to the corresponding view-number, to refelct the required color.

my question is: can such a thing easier be done using setpalrbg  or soemthing like it?

Kind regards,
martijn

Ben

Well, to make it work by changing the palette, you'd need to draw each wire in a different color.. Then you'd have to match the current with each color element (red, green, and blue). It might turn out to be more complicated than what you're doing now (a different graphic for each wire typr, and each voltage?).

One thing that might help, though, is to organize your wire graphics into views and loops.. For example, if you have eight different types of wires, have a loop for each type, then put each voltage amount as a frame, so a low voltage for any wire would be frame 0, and a high voltage would be frame 10.. Would that help?

spook1

I have different views for each wire now. That is, three pictures for each view, a blue, red and yellow one.
I plan to start the view, in still mode at a different picture.

How can i apply loops?

Scorpiorus

I'm agree that although the pallete thingy is possible it could make things more complicated than it's worth.

Quote from: spook1 on Sun 14/03/2004 19:06:43How can i apply loops?
It's just a matter of organization. You can go with having different views for each color or (what Ben meant) you can use one view but put in use all its loops.

Organization depends on how you want to visualize wires, the current flows through. If you want to animate the flow (could be a transition from light blue to dark blue or whatever) you can assign one loop for each color:

VIEW 1
loop 0:  dark-blue___blue___light-blue___blue
loop 1:  dark-red____red___light-red____red
loop 2:  dark-yell____yell___light-yell____yell

than using SetObjectFrame() you set appropriate loop number:
if (low)       SetObjectFrame (object, view=1, 0, 0);
if (higher)    SetObjectFrame (object, view=1, 1, 0);
if (very high) SetObjectFrame (object, view=1, 2, 0);

...and animate

AnimateObject(...);

~Cheers

SMF spam blocked by CleanTalk