camera tracking

hi again,

another few questions im afraid, maybe oneday ill be able to help someone else out!!!

  1. camera’s. ive got a few cameras set up so that they track and are constrained to the central object in my scene, ive given them animation paths[?] so that when i hit alt-a the camera rotates in a big circle around the object and is always looking at it. however in the game when i play the camera animation, the camera is always facing the direction it was in frame 1, it moves around the object but doesnt point towards it. does that make sense…

ive tried all of the track x/-x/y/-y/z/-z settings

  1. can the game engine handle mesh animations, ie vertices moving about in an anim, and are there any special setting i need to make this work

3.am using the script z3r0 d replied with-

import Rasterizer

Rasterizer.setBackgroundColor ([0,0,0,0])

to set background colours, how simple would it be to write a script that added 1 to one of the r g or b value, when i pressed a key. i am very new to python.

thanks again

Ok, first of all constraints that are used for anamations are not supported! You need an edit pbject actuator that is set to track to and with the fields filld out.

Second, no. Mesh anamations are not su[[orted in the game engine. You can use armatures to deform meshes or even python but no mesh anamations.

Third, yes


import GameLogic
import Rasterizer
cont = GameLogic.getCurrentController()
Own = cont.getOwner()

own.backcolor = own.backcolor + 1
Rasterizer.setBackgroundColor ([own.backcolor,0,0,0]) 


You would need a property in the object that is running the script called backcolor

thanks for the help but i guess i should have explained what i wanted a bit better, when i hit a key id like the background to fade to another colour. so using your script i came up with this

import GameLogic
import Rasterizer
cont = GameLogic.getCurrentController()
Own = cont.getOwner()

Rasterizer.setBackgroundColor ([own.timer,0,0,0])

with a timer property called timer

but when i hit the key the background automatically jumped to full red, 255. i thought this might be due to the timer being a float rather than an int. so i added a int property called prop and changed the script to

import GameLogic
import Rasterizer
cont = GameLogic.getCurrentController()
Own = cont.getOwner()

own.prop = own.timer
Rasterizer.setBackgroundColor ([own.prop,0,0,0])

the same problem still occurs, ive tried print own.prop and own.timer and they show int and float number respectively so am unsure as to what ive done wrong.

i know the fade will only update when i hit the key but can i use pulses so as i hold the key down it fades/continually updates.

thanks a lot for the help

hmm… i think Blender dont use the 255 thingy. i think that 1.00 is full and 0.00 is the lowest. i may be wrong, becaus i havent tested this since 2.25

no your right mate! thanks a lot, ive set up some properties so when the timer reaches 1 it resets to zero again tihs works but im getting a kinda epileptic stutter effect which is cool but do u know any way of slowing that timer down!! ha
also is there a command like - getBackgroundColor and is it possible to implement this so that the script reads off what the current values of r g and b are then adds to them the timers value. or is this something i should attempt once ive learnt a bit more python.

Cheers

ok, so i was a bit tired last night; have figured out how to make the fade slower- have a timer that counts to 10 and then

import GameLogic
import Rasterizer
cont = GameLogic.getCurrentController()
Own = cont.getOwner()

time= own.timer / 10
Rasterizer.setBackgroundColor ([time,0,0,0])

just thought id post it in case anyone found it useful. any ideas on how to get the current background colour then add or deduct from this number- any ideas would be much appreciated.