Search found 226 matches

by pandoragami
Mon Mar 02, 2015 1:19 am
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

mongoose7 wrote:You may need a texture.
thanks,

Besides this line?

Code: Select all

sphere->setMaterialTexture( 0, driver->getTexture("graph.jpg"));
The image does show on the sphere no problem. Is there something else I need to add for the texture? Is there transparency alpha for the texture itself?
by pandoragami
Sun Mar 01, 2015 10:32 pm
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

Oh come on - try a little bit before asking each step. Try using 0 again for example instead of 255. I tried 0 or 255 but no luck. Am I missing some other mesh material methods?   scene::IMesh* sphere_mesh = sphere->getMesh();     scene::IMeshBuffer* sphere_mesh_buffer = sphere_mesh->getMeshBuffer(...
by pandoragami
Sun Mar 01, 2015 8:25 pm
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

IMesh (which you got from getMes()) has functions to access the meshbuffers. That node will only have one so you just need to access the first one. I think I have it right but still no transparency :?   #include <irrlicht.h> using namespace irr;   class MyEventReceiver : public IEventReceiver { pub...
by pandoragami
Sun Mar 01, 2015 6:15 pm
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

mongoose7 wrote:

Code: Select all

Meshbuffer->Material.DiffuseColor.setAlpha( (s32)(value * 255) );
Meshbuffer->Material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;

Sorry for my ignorance but how do I turn my sphere of IMeshSceneNode into a Meshbuffer?
by pandoragami
Sun Mar 01, 2015 1:09 pm
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

There's a post by an author call feelthat. I saw a few weeks back, he did transparent even for animated mesh. I think he fixed other issues he found as well. Actually there's also lot of posts on the related issue if you search the forum. http://irrlicht.sourceforge.net/forum/viewtopic.php?t=31400 ...
by pandoragami
Sun Mar 01, 2015 5:08 am
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

Hm, I really have to sleep, so won't test now. But I suppose it's because the material used in the mesh is solid. Try using any material supporting transparence like video::EMT_TRANSPARENT_ADD_COLOR. Goodnite, thanks so far though, this code below works now except that the texture cannot be alpha b...
by pandoragami
Sun Mar 01, 2015 4:30 am
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

Here's the complete code   #include <irrlicht.h>   using namespace irr;   class MyEventReceiver : public IEventReceiver { public:       struct SMouseState     {         core::position2di Position;         bool LeftButtonDown;         SMouseState() : LeftButtonDown(false) { }     } MouseState;       ...
by pandoragami
Sun Mar 01, 2015 4:23 am
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

IMeshSceneNode is derived from ISceneNode, meaning it has everything ISceneNode has + some additional stuff. That's why you can always cast safely to the base-classes. Not sure right now if the alpha value means transparence or opaque, doesn't seem to be documented. Just try it with 255 maybe. Trie...
by pandoragami
Sun Mar 01, 2015 3:24 am
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

Well, then take a look at the documentation which type addSphereSceneNode does return: http://irrlicht.sourceforge.net/docu/classirr_1_1scene_1_1_i_scene_manager.html#acd6454347276ff8c74e46063970cfc04 Maybe you are lucky and it's real type does have such a function ;-) It returns a type IMeshSceneN...
by pandoragami
Sun Mar 01, 2015 2:37 am
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

Use sphere->getMesh() to get the mesh. Tried but got this error.   scene::ISceneNode* sphere = smgr->addSphereSceneNode(radius, 32, 0, -1, core::vector3df(0, 0, 0), core::vector3df(0, 0, 0), core::vector3df(1.0f, 1.0f, 1.0f));     sphere->setMaterialFlag(video::EMF_LIGHTING, false);     sphere->set...
by pandoragami
Sat Feb 28, 2015 10:03 pm
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

Re: setting transparency (alpha) for spherescenenode?

You can try to experiment with IMeshManipulator::setVertexColorAlpha. As each sphere-node has it's own mesh that should work. Thanks so far, I tried this scene::IMeshManipulator* mesh = smgr->getMeshManipulator(); mesh->setVertexColorAlpha(sphere, 0); But the compiler complains that my sphere isn't...
by pandoragami
Sat Feb 28, 2015 7:09 pm
Forum: Beginners Help
Topic: [SOLVED] setting transparency (alpha) for spherescenenode?
Replies: 42
Views: 3479

[SOLVED] setting transparency (alpha) for spherescenenode?

Hi All, Sorry for asking such a noobish question considering that this has probably been answered before but I did search and found very little on how to do it, including this page http://irrlicht.sourcearchive.com/documentation/1.7.2plus-pdfsg1-1/ISceneNode_8h_source.html Anyways I have this code w...
by pandoragami
Mon Feb 16, 2015 8:45 pm
Forum: Beginners Help
Topic: Creating an inherited class from ITimer?
Replies: 7
Views: 890

Re: Creating an inherited class from ITimer?

I only use it to get the time. Time is time... short of creating another universe I can't do much about that :-) The difference it that this one can be started/stopped independent of each other. But if you have only a single instance of ITimer and used one of the methods in the Timer wrapper you ca...
by pandoragami
Mon Feb 16, 2015 5:17 pm
Forum: Beginners Help
Topic: Creating an inherited class from ITimer?
Replies: 7
Views: 890

Re: Creating an inherited class from ITimer?

CuteAlien wrote:Yeah, it looks similar to ITimer as it's basically a wrapper around it. And yes - that's the pointer you pass.
But isn't that the same instance of the ITimer which implies that you would still have one timer for each Irrlicht device?
by pandoragami
Mon Feb 16, 2015 2:46 pm
Forum: Beginners Help
Topic: Creating an inherited class from ITimer?
Replies: 7
Views: 890

Re: Creating an inherited class from ITimer?

So much for the theory. But you likely don't need that. You can't pass a timer back to Irrlicht so deriving from that is probably useless. If you need a timer then either write your own class - or use the a pointer to the Irrlicht timer in your class (here's an example where I do that: http://www.m...