|
Playing a movie on a model
#201890
04/11/08 21:25
04/11/08 21:25
|
Joined: Feb 2002
Posts: 357 Florida
Zelek
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2002
Posts: 357
Florida
|
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?
|
|
|
Re: Playing a movie on a model
[Re: Zelek]
#201901
04/11/08 21:57
04/11/08 21:57
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
Expert
|
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
Perhaps a skin in MED has the time to initialise (of some sort) on the model, in your code it does not. Try a wait(1); between setskin and mediaplay. I honestly don't think it helps, but worth a try eh .
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Playing a movie on a model
[Re: Joozey]
#201905
04/11/08 22:09
04/11/08 22:09
|
Joined: Feb 2002
Posts: 357 Florida
Zelek
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2002
Posts: 357
Florida
|
|
|
|
Re: Playing a movie on a model
[Re: Zelek]
#201926
04/12/08 00:28
04/12/08 00:28
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
It's then very likely a problem with the uv set. Maybe ventilator can help here as he wrote the plugin for a second uv set.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
|