How can i set mosaic texture?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

How can i set mosaic texture?

Post by Necrozard »

Well, first of all, sorry about my flood of newbie questions xD, but i really want to learn Irrlicht.

Well, i set a Texture to a IAnimatedMeshSceneNode, and, its TOTALLY SCALED, and its big, so its look horrible, how can i set a flag or something to set mosaic texture, to repeat the texture its original size.

Thanks again!
piiichan
Posts: 59
Joined: Thu May 01, 2008 1:20 am
Location: New Caledonia (France - Pacific)
Contact:

Post by piiichan »

Try this

Code: Select all

node->getMaterial(0).getTextureMatrix(0).setTextureScale(10,10);
The scale of the texture is the number of times the texture will be repeated.

It's working, but I get an error when the program ends: the debugger brings me to ireferencecounted.h, line 124.
Is it a bug, or am I doing something wrong?
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

Post by Necrozard »

It works! Thanks!
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

Post by Necrozard »

Well, i have a new problem!

If your line isnt in my code, the texture of Dwarf (Warrior) its there, but if a set it in my code, the texture of the floor scale good, but Dwarf´s texture dissapear, whats happening? I have a screenshots:

Image
Here is my code normally WITHOUT floor->getMaterial(0).getTextureMatrix(0).setTextureScale(600,600);
As you see, the texture of the floor is mega-scaled.


Image
Here is my code WITH floor->getMaterial(0).getTextureMatrix(0).setTextureScale(600,600);
Now, floor´s texture is ok but Dwarf´s texture dissapear.


Do you know why?

Thanks a lot!
piiichan
Posts: 59
Joined: Thu May 01, 2008 1:20 am
Location: New Caledonia (France - Pacific)
Contact:

Post by piiichan »

Could you post your entire code?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You could also try:

Code: Select all

SceneManager->getMeshManipulator()->makePlanarTextureMapping(YOURMESHHERE, TRYDIFFERENTVALUESHERE);
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

looks the material of dwarf and floor is the same?

yesss!!!

that's it.

Image
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

dlangdev wrote:looks the material of dwarf and floor is the same?
Are you insane? (rhetorical question)
Image Image Image
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

Post by Necrozard »

Ok, thanks everybody.

@BlindSide: It doesnt work, i dont know why. it says no matching funtion for call.

Well, here is a .rar archive, it has Dev-cpp Project+main.cpp, and the media folder. I will really appreciate if somebody fix my problem, thanks again and bye!

LINK: http://www.mediafire.com/?tciigwjzzgc

PD: Sorry about the comments and some variables, they are in Spanish.
pepeshka
Posts: 29
Joined: Wed Jul 02, 2008 8:42 pm

Post by pepeshka »

I'm having a similiar problem...
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

that's better, code is much better than talk.

well, now you made him talk.

Image
Image
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

Post by Necrozard »

Can someone fix the problem please? I really need it!
piiichan
Posts: 59
Joined: Thu May 01, 2008 1:20 am
Location: New Caledonia (France - Pacific)
Contact:

Post by piiichan »

I can't access your rar archive coz my proxy server is VERY strict (student proxy :roll: ).

Post your main.cpp on the forum and let's have a look.
Necrozard
Posts: 14
Joined: Sat Jul 05, 2008 8:49 pm

Post by Necrozard »

BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

@BlindSide: It doesnt work, i dont know why. it says no matching funtion for call.
The first parameter is an IMesh, the second parameter is a float.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply