I am playing a 640x480 movie on a plane model using the following code:
ent_movie = ent_create ("plane.mdl", vector(distance,0,0), NULL);
ent_setskin(ent_movie,bmap_createblack(640, 480, 24),1);
ent_movie.scale_x=(640/480);
...
media_play(movie_name,bmap_for_entity(ent_movie,0),100);
This works, but the problem is that the movie doesn't correctly map onto the plane - there is an empty space on the right hand side of the model:
I tried using a different movie in a different format with a size of 352x240, and it had the same problem, except that the bottom portion of the window was being cut off. What do I need to do to get a movie to fit exactly onto the plane?
EDIT:So the problem seems to be that the model's texture maintains the ratio of the original skin, even after I call ent_setskin during runtime. For instance, if the model has a 256x256 texture in MED and then I call ent_setskin with a 320x240 texture, it will apply the new texture as a perfect square rather than with the new ratio. Is there a way around this?