Harry
Member
|
[Solved]Decals and wheel trace
Hello,
I'm trying to add wheels traces by using decals and I have a little question about drawing my traces.
http://img26.imageshack.us/img26/4130/scrsh4.jpg
As you can see some decals are extended or narrowed. I've checked tutorial and I saw thet when I shot between barrel and ground I have similar effect:
http://img294.imageshack.us/img294/4130/scrsh4.jpg
This is part of code which create decals:
Code:
Game::World.terrainAddDecal(WHITE,Materials.ptr("Gfx/Trace/Trace.mtrl"),wheel[2].matrix());
Is here something wrong?
(This post was last modified: 09-15-2010 05:51 PM by Harry.)
|
|
09-08-2010 06:49 PM |
|
Harry
Member
|
RE: Decals and wheel trace
Problem aboive is solved.
How can I rotate decals which I put on the terrain? I tried some transformations with matrix but it doesn't help.
|
|
09-09-2010 12:21 PM |
|
Esenthel
Administrator
|
RE: Decals and wheel trace
setting correct matrix should do the trick
|
|
09-13-2010 05:01 PM |
|
Harry
Member
|
RE: Decals and wheel trace
http://img689.imageshack.us/img689/4130/scrsh4.jpg
1st code:
Code:
Game::World.terrainAddDecal(WHITE,Materials.ptr("Gfx/Trace/Trace.mtrl"),Matrix().setRotateY(T.matrix().angles().y).move(T.wheel[2].matrix().pos-Vec(0,0.2,0)).scaleOrn(0.3f));
2nd code:
Code:
Game::World.terrainAddDecal(WHITE,Materials.ptr("Gfx/Trace/Trace.mtrl"),Matrix().setPosDir(wheel[3].matrix().pos-Vec(0,0.2,0),Vec(0,1,0)).scaleOrn(0.3f));
In the first code as you can see traces isn't draw properly but they are rotating. In the second code I tried many ways to rotate this but I failed. Could someone give me an advice?
(This post was last modified: 09-13-2010 06:47 PM by Harry.)
|
|
09-13-2010 06:47 PM |
|
Dynad
Member
|
RE: Decals and wheel trace
Well maybe u can try it with Lerp() so it interpolates between 2 decals.
But what i think about your first code.. its looks like it that the decals turns in the wrong direction.
There is always evil somewhere, you just have to look for it properly.
|
|
09-13-2010 06:55 PM |
|