How can i create a box or a 3d mesh when i click a mouse button or when i press a button
Need some help..
Need some help..
Hi,
How can i create a box or a 3d mesh when i click a mouse button or when i press a button
.Im not so good in irrlicht so a small code would help me to understand better .THANKS
How can i create a box or a 3d mesh when i click a mouse button or when i press a button
Re: Need some help..
That's what the tutorials are written for!WWW wrote:Im not so good in irrlicht so a small code would help me to understand better .THANKS
1st: a subject like "Need some Help.." doesn't say anything, everybody who opens a new thread in this forum needs help, that's why they open a new thread, so please choose a more specific subject the next time...
2nd: if you're "not so good in Irrlicht" than please work through the tutorials first, all of your question are covered there...
for example the button click is covered in tutorial #05.UserInterface and the creation of a simple cube is covered in many tutorials (e.g. #04.Movement)...
2nd: if you're "not so good in Irrlicht" than please work through the tutorials first, all of your question are covered there...
for example the button click is covered in tutorial #05.UserInterface and the creation of a simple cube is covered in many tutorials (e.g. #04.Movement)...
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
You didn't understand what i want (or maybe i give you too little information
)
I checked all the tutorials and none is what i want.So, I want to create(let's say) a mesh with left mouse click an to be positioned in front of the camera.How can I do that ???
I know how to position the mesh in front of the camera , i know how to create event receiver for mouse click but i dont know how to create multiple meshes with their own position (or maybe other variable like health or armour for an enemy).
I think this can be done with classes
but i dont know how 
THANKS again
I checked all the tutorials and none is what i want.So, I want to create(let's say) a mesh with left mouse click an to be positioned in front of the camera.How can I do that ???
I know how to position the mesh in front of the camera , i know how to create event receiver for mouse click but i dont know how to create multiple meshes with their own position (or maybe other variable like health or armour for an enemy).
I think this can be done with classes
THANKS again
well, if you know all this than there should be no problem to create multiple meshes...
simply do what you did for a single mesh to create as much meshes as you want and you'll get several meshes (no need to use classes for this)...
simply do what you did for a single mesh to create as much meshes as you want and you'll get several meshes (no need to use classes for 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
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Code: Select all
// Create a collection of pointers to nodes.
// Here I am using Irrlicht's 'array' collection class
irr::core::array<IAnimatedMeshSceneNode *> nodes;
...
// Create a new node, using whatever method you're currently using
IAnimatedMeshSceneNode * newNode = ...your node creation method...
// Add it to the end of collection of nodes
nodes.push_back(newNode);
...
// Now loop through all the nodes in the collection,
// and do whatever you need to do to them.
for(u32 i = 0; i < nodes.size(); ++i)
{
IAnimatedMeshSceneNode * node = nodes[i];
// .... do something with each node
}
(This is untested, and personally I wouldn't become reliant on Irrlicht by using its collection classes, but it should give you the general idea)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
ahh, now we come to the point !!!WWW wrote:LOL![]()
, you are right Aki ,thanks ,but how can i access them individually?(for exemple if i want to check the third mesh)
as rogerborg said you could use an array for this...
or you can give each node an individual ID and get the node later by its ID:
Code: Select all
// create 10 nodes with IDs from 1 to 10
for(int ID = 1; ID <= 10; ID++){
smgr->addAnimatedMeshSceneNode(ptMesh, 0, ID);
}
// then later get the wanted node by its ID (here ID = 3)
ISceneNode* testNode = smgr->getSceneNodeFromId(3);
// now you can do what you want with this node...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
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Heh, I'd never even thought of using a scene nodes 'Id' as an actual Id rather than as a set of bitflags for collision. I wonder if we could take the hit in 1.5 of separating Id and flags?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way