3 registered members (Quad, Akow, 7th_zorro),
756
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
View on modell
#387529
11/20/11 11:25
11/20/11 11:25
|
Joined: Sep 2009
Posts: 496
Progger
OP
Senior Member
|
OP
Senior Member
Joined: Sep 2009
Posts: 496
|
Hi community I need your help I try to get a view on a model but it still dont work I searched in the aums and found a script but this only works on sprites how can ic chnage it that it works on models also ?
Q: Is it possible to render a view on a target like a model, a texture or a bmap? I'd like to use that as a mirror, for example.
A: Sure, take a peek.
ENTITY* mirrorsprite;
VIEW* mirror_view;
action mirror_sprite() // attach this action to a sprite / model that will be used for the mirror
{
mirrorsprite = my;
set (my, PASSABLE | DECAL);
}
function mirror_startup()
{
while (!mirror_sprite) {wait (1);}
mirror_view = view_create(10); // set the layer value for the new view to 10
wait (2);
set (mirror_view, SHOW);
mirror_view.size_x = 128;
mirror_view.size_y = 128; // the mirror sprite has 128x128 pixels
mirror_view.bmap = bmap_for_entity(mirrorsprite, 0);
vec_set(mirror_view.x, vector(1000, 500, 100)); // set the position of the mirror "eye"
vec_set(mirror_view.pan, vector(0, -10, 0)); // set the angles of the mirror "eye"
}
When i apply this to a model nothing changes you can not see a view on it. When i use a sprite it works perfectly Can you explain me from step to step how to do that. How many skins shell the model have? Because i think iam doing something wrong I really need your help!! Thanks for reading this and also for your help WFG Progger
Last edited by Progger; 11/20/11 11:26.
|
|
|
Re: View on modell
[Re: 3run]
#387583
11/21/11 01:45
11/21/11 01:45
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Firstly, I would suggest using ent_getskin(mirrorent,1) rather than bmap_for_entity. I have had far more success using it, its just far more reliable.
Secondly, if it is working on a sprite for you, why not use it into an ent_decal? Paste the decal onto your entity, an it would work the same I believe.
Thirdly, if ent_decal dont work, or is un-do-able, I BELIEVE you will need two skins on your model. Skin1 is the models general texture, and skin2 a 128x128 texture mapped entirely onto the 'reflective' portion of the model. Oh, and use 'bmap=ent_getskin(mirrorent,2)' in the view.
See if that can get you started. It will take a bit of tweaking to get it looking right I believe. But what Ive given you should get at least some of the view mapped into the model.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: View on modell
[Re: EvilSOB]
#387710
11/22/11 15:22
11/22/11 15:22
|
Joined: Sep 2009
Posts: 496
Progger
OP
Senior Member
|
OP
Senior Member
Joined: Sep 2009
Posts: 496
|
Thank you very much EvilSOB Ill try all tipps u gave me ent_getskin also dont work now ill try to use decals Hope that will work WFG PRogger
|
|
|
Re: View on modell
[Re: Progger]
#387713
11/22/11 15:39
11/22/11 15:39
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Looking forward to your results...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: View on modell
[Re: EvilSOB]
#387870
11/24/11 21:43
11/24/11 21:43
|
Joined: Sep 2009
Posts: 496
Progger
OP
Senior Member
|
OP
Senior Member
Joined: Sep 2009
Posts: 496
|
So sorry for not posting but i had to do much to do in school. Well then first i want to thank you all I did a big mistake in my code so itcould not work^^ Well thanks to all who helped me and especially to 3run who made an example for me so i could compare both codes and finally found the error. Here is the picture: WFG Progger
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|