About Store Forum Documentation Contact



Post Reply 
[Solved]Decals and wheel trace
Author Message
Harry Offline
Member

Post: #1
[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
Visit this user's website Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #2
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
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Decals and wheel trace
setting correct matrix should do the trick
09-13-2010 05:01 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #4
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
Visit this user's website Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #5
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
Visit this user's website Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #6
RE: [Solved]Decals and wheel trace
Thank you Dynad for give me a clue. I rotate decals in y axis by 90 degrees and now they are drawing ok smile
09-15-2010 05:53 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply