assigning a plane
assigning a plane
i want to set a plane3d equal to an edge of a bounding box, but planes only have a position and a normal.
are they infinite length or am I missing something?
are they infinite length or am I missing something?
yeah what exactly is a plane3d, I thougth it could be used for the rotation of an triangle: core::plane3d<f32> rotation = triangle.getPlane();
If I am right I might have done good by tying: bullethole->setRotation(rotation); to set the flat model on the triangle with the same rotation, but now I have an error: cant convert from plane3d to vector3df.
If I use the right function: how to solve this convertion,
and if I don't: what function should I use than?
If I am right I might have done good by tying: bullethole->setRotation(rotation); to set the flat model on the triangle with the same rotation, but now I have an error: cant convert from plane3d to vector3df.
If I use the right function: how to solve this convertion,
and if I don't: what function should I use than?
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
strangely all the models get set to one same direction, unless the triangle faces point into another direction
The function to make only the 'bullethole' on the node 'doos' doesn't work that great either 
Code: Select all
if (sm->getSceneCollisionManager()->getCollisionPoint(
line, metaSelector, end, triangle))
core::plane3d<f32> rotation = triangle.getPlane();
selectedSceneNode = sm->getSceneCollisionManager()->
getSceneNodeFromCameraBB(sm->getActiveCamera());
if (selectedSceneNode == doos)
{
mesh = sm->getMesh("hole.ms3d");
bullethole = sm->addAnimatedMeshSceneNode(mesh);
bullethole->setMaterialTexture(0, device->getVideoDriver()->getTexture("hole.jpg"));
bullethole->setMaterialFlag(video::EMF_LIGHTING, false);
bullethole->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
bullethole->setPosition(Impacts[i].pos);
//bullethole->setRotation(sm->getActiveCamera()->getRotation());
bullethole->setRotation(rotation.Normal);}Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
can't figure out

but the selectednode for 'doos' doesn't work because he checks the camera when the 'bullet' hits the wall
but the selectednode for 'doos' doesn't work because he checks the camera when the 'bullet' hits the wall
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
I made it a:The source is like the techdemo.
The bulletholes are not anymore set the same direction, but it nearly seems to be random, I have no idea what's wrong.
Code: Select all
core::vector3df rotation;
core::vector3df out = triangle.getNormal();
imp.rotation = out;
out.setLength(0.03f);
imp.when = 1;
imp.outVector = out;
imp.pos = end;
Impacts.push_back(imp);
//and all for the mesh, I only changed:
bullethole->setRotation(Impacts[i].rotation);The bulletholes are not anymore set the same direction, but it nearly seems to be random, I have no idea what's wrong.

Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
I tried to edit the model some times, on one side of the cube (a.k.a. doos) the holes are facing in the right way, while the holes on the other side will point a whole other directionDances wrote:Its not random, its facing almost a complete 90 degrees from whatever face its in, try setting a rotation of 90 or so after getting the normal.
this are 3 sides of the cube, Try for yourself, the demo is uploaded on my website http://members.lycos.nl/phpgenerals/plethoraVisit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
getTargetAngle from the AI class?
I can only find getTargetThis is the code from the techdemo and the particle smoke which is created is in the same angle as the face it's created on
only hard to figure out what it should be 
I can only find getTarget
Code: Select all
pas = sm->addParticleSystemSceneNode(false, 0, -1, Impacts[i].pos);
pas->setParticleSize(core::dimension2d<f32>(10.0f, 10.0f));
scene::IParticleEmitter* em = pas->createBoxEmitter(
core::aabbox3d<f32>(-5,-5,-5,5,5,5),
Impacts[i].outVector, 20,40, video::SColor(0,255,255,255),video::SColor(0,255,255,255),
1200,1600, 20);Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
If I do rotation = camera->getTarget(); it have nearly the same 'random' rotation 
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
try control+scrollwheel, it zooms in on text on a web page you know 
http://irrforge.org/index.php/AI_Class_For_Irrlicht
now use the code from getTargetAngle to find the angle between the plane's position and its normal.
http://irrforge.org/index.php/AI_Class_For_Irrlicht
now use the code from getTargetAngle to find the angle between the plane's position and its normal.
I know for sure that AI class function is different than I ment. This getTargetAngle does calculates the angle between the node and the target, but I guess it only calculates from a boundingbox, I have to know how to get the rotation of a single triangle.

Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP