Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, degenerate_762, ozgur), 1,311 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Playing a movie on a model #201890
04/11/08 21:25
04/11/08 21:25
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I am playing a 640x480 movie on a plane model using the following code:
 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] #201892
04/11/08 21:27
04/11/08 21:27
Joined: Mar 2008
Posts: 67
crumply Offline
Junior Member
crumply  Offline
Junior Member

Joined: Mar 2008
Posts: 67
If you get this working I'd quite like to see the full source for this movie thing \:\)

Re: Playing a movie on a model [Re: crumply] #201897
04/11/08 21:35
04/11/08 21:35
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I'll be happy to release the full code in a few weeks when it's done. It's a tool to apply post-processing effects to movies.

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 Offline
Expert
Joozey  Offline
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 Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
No luck. Thanks, though.

Re: Playing a movie on a model [Re: Zelek] #201914
04/11/08 23:20
04/11/08 23:20
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
This is probably the cause of the problem: From the manual look under texture

"3D cards can not render arbitrary texture sizes. They require power-of-2 texture sizes (32, 64, 128, 256, 512, 1024...), like 64x128 or 128x512. All other sizes are automatically 'inflated' by the engine to the next power of 2, however at cost of video memory, performance, and image quality."

cheers

Re: Playing a movie on a model [Re: tindust] #201920
04/12/08 00:08
04/12/08 00:08
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I thought that might be the case too, but if I set the texture on the model to 640x480 in MED, and then load the level, the video fits perfectly. So it must not be a problem with the texture dimensions but rather changing it dynamically.

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 Offline
Expert
Uhrwerk  Offline
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...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1