lino Wrote:I think that the best method would be to modify an existing
track to put the VAS and then to add some code to the engine to modify
this sign (maybe putting some texture over it) when the car is near.
Since this is just for the purpose of a demo, I think the best approach would be to model the sign in blender, export it to .joe format, and then add code to VDrift that draws the model at hard-coded coordinates for a specific track. For the texture, create a texture for the sign inactive and a texture for the sign active, and switch between them based on how close the car is, how fast it's moving, etc.
The classes you'll need to use are in texture.h, model_joe03.h plus model.h, and scenegraph.h. The basic approach to drawing an object is to, once at loading time:
* create a MODEL_JOE03 object
* call the MODEL_JOE03::Load() function with your model's path
* create two TEXTURE_GL objects, one for the active sign and one for the inactive sign
* call the TEXTURE_GL::Load() functions with your texture paths (you actually create a TEXTUREINFO class with information about the texture you want to load and pass it to the Load function)
* call SCENENODE::AddNode() on the game's top-level SCENENODE object, and store the pointer you get
* call SCENENODE::AddDrawable() on your scenenode pointer, and store the pointer you get
* set up the DRAWABLE pointer with your inactive diffuse texture and your model
* set up the transform (via SCENENODE::GetTransform()) on your scenenode pointer to move the object to where you want it to be drawn
Then, every frame, check to see if the conditions are there to activate your sign, and then just use DRAWABLE::SetDiffuseMap() on your drawable pointer to switch to the active texture.
Hopefully that will get you started.