About Store Forum Documentation Contact



Post Reply 
Trouble applying decals on code generated 3d objects.
Author Message
SamerK Offline
Member

Post: #1
Trouble applying decals on code generated 3d objects.
Hi, I'm having trouble applying a decal over code generated 3D objects(not EE editor objects ). Let me explain what I did ...

- I set the decal to be terrain_only.
decal.terrain_only=true;
(note that applying decals will work if this is false, but what I'm looking for is to get it applied only to terrain type objects)

- then on the created mesh I made an actor using its physics part and assigned it under AG_TERRAIN group.

MeshBase base;
PhysPart phys;
Actor actor;

base.createPhys(mesh); // where mesh refers to the created mesh
phys .createMesh(base);
actor.create (phys).group(AG_TERRAIN) ;


I hope what I explained is clear.

Thanks.
(This post was last modified: 09-08-2013 03:34 PM by SamerK.)
09-08-2013 03:33 PM
Find all posts by this user Quote this message in a reply
SamerK Offline
Member

Post: #2
RE: Trouble applying decals on code generated 3d objects.
Help is really appreciated to make created mesh as terrain type to enable decal drawing on it. I'm really clueless!!

Thanks.
(This post was last modified: 09-10-2013 04:40 PM by SamerK.)
09-10-2013 04:39 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: Trouble applying decals on code generated 3d objects.
AG_TERRAIN is only for physics actor, you'll need to use 'SetStencilValue'
09-12-2013 02:39 AM
Find all posts by this user Quote this message in a reply
SamerK Offline
Member

Post: #4
RE: Trouble applying decals on code generated 3d objects.
Thank you so much its working now as I wanted. its funny sometimes when you work several days trying to find a solution then suddenly a small command popup to solves the whole issue in a second smile. anyway nothing goes waste this is part of the learning process.

to complete this thread the code should be then .

switch(Renderer())
{
case RM_PREPARE:
{
SetStencilValue(true); // will make the mesh to receive terrain only decal
mesh.draw(MatrixIdentity);

}break;
}
09-12-2013 01:37 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Trouble applying decals on code generated 3d objects.
please also reset the value to default state after calling mesh.draw(..); using SetStencilValue();
09-12-2013 11:02 PM
Find all posts by this user Quote this message in a reply
SamerK Offline
Member

Post: #6
RE: Trouble applying decals on code generated 3d objects.
Sure, thanks again.
09-13-2013 12:37 AM
Find all posts by this user Quote this message in a reply
Post Reply