I create a 3d "wall" for "painting" in my game(for practice), I want it like this: when I click the "wall", an image would be "painted" on the target point of the "wall".
Is there any solution ??
thank you very much.
How to draw a 2D image onto a 3d scene node??
-
mrwang2000
- Posts: 7
- Joined: Mon Jan 28, 2008 5:09 pm
- Location: China
you can check out the collision tutorial. i think you can use that to determine the position where you should put your quad with the texture.
My company: https://kloena.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
My profile: https://zhieng.com
My co-working space: https://deskspace.info
My game engine: https://kemena3d.com
you could try to use a decal for this... 
it's the same if you "paint" a bullet hole or a picture to the wall...
http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=21113
it's the same if you "paint" a bullet hole or a picture to the wall...
http://irrlicht.sourceforge.net/phpBB2/ ... hp?p=21113
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
mrwang2000
- Posts: 7
- Joined: Mon Jan 28, 2008 5:09 pm
- Location: China
first, thank you for your fast reply.
I have got the interaction point and triangle on the "wall", but I do not know how to draw the "Image" just like pasting on the "wall"
Acki:
I compile your code but got a compiler error:
can not found ISceneNode::OnPreRender()... ...
and there is another question: when the interaction point is near by the "wall" and "ground", if the "wall" can only display part of the "image", I want that the rest part of the "image" can be painted on the ground. how to do that???
thanks again
I have got the interaction point and triangle on the "wall", but I do not know how to draw the "Image" just like pasting on the "wall"
Acki:
I compile your code but got a compiler error:
can not found ISceneNode::OnPreRender()... ...
and there is another question: when the interaction point is near by the "wall" and "ground", if the "wall" can only display part of the "image", I want that the rest part of the "image" can be painted on the ground. how to do that???
thanks again
well, it's not my code... 
ok, OnPreRender doesn't exist anymore, it was changed to OnRegisterSceneNode, so simply change the function name...
but if you don't get it to work, you can also try my IrrExtensions, there I added a decal scene node similar to this one...
for the ground thingy you'll have to do some math...
you need to know the height of the floor and the position of the front of the wall...
also the height/position and size of the "painting"...
than you can calculate how many of the painting on the wall is below the floor and put a second painting on the floor so it looks just the missing part out of the wall...
I hope you know what I mean...
also there are probably other ways to do this...
ok, OnPreRender doesn't exist anymore, it was changed to OnRegisterSceneNode, so simply change the function name...
but if you don't get it to work, you can also try my IrrExtensions, there I added a decal scene node similar to this one...
for the ground thingy you'll have to do some math...
you need to know the height of the floor and the position of the front of the wall...
also the height/position and size of the "painting"...
than you can calculate how many of the painting on the wall is below the floor and put a second painting on the floor so it looks just the missing part out of the wall...
I hope you know what I mean...
also there are probably other ways to do this...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:

http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
mrwang2000
- Posts: 7
- Joined: Mon Jan 28, 2008 5:09 pm
- Location: China
-
mrwang2000
- Posts: 7
- Joined: Mon Jan 28, 2008 5:09 pm
- Location: China
mrwang2000 wrote:thank you Acki.
after change code as you told me , I can successfully compile my application now.
but I can only draw a "white box" on my "wall" , the image and the transparency feature seems not work, could you give me some suggestion??
OK, the images can display now
-
mrwang2000
- Posts: 7
- Joined: Mon Jan 28, 2008 5:09 pm
- Location: China
OK,the transparency is work now too,mrwang2000 wrote:mrwang2000 wrote:thank you Acki.
after change code as you told me , I can successfully compile my application now.
but I can only draw a "white box" on my "wall" , the image and the transparency feature seems not work, could you give me some suggestion??
OK, the images can display now, but the transparency ... ...
thank you all very much!!!!!!
-
FuzzYspo0N
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact: