tutorial on point clouds and polygons

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.
Post Reply
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

tutorial on point clouds and polygons

Post by pandoragami »

I've been trying to find a good example on using this method for a point cloud

Code: Select all

ISceneNode.setMaterialFlag(E_MATERIAL_FLAG.EMF_POINTCLOUD, true).
I also wanted to know how I can draw polygons such as cubes and spheres in 3d.
thanks
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

Post by Anthony »

addCubeSceneNode 8) goes for a sphere too

but what is a pointcloud

EDIT: thanks RaverGames
Last edited by Anthony on Fri Jan 28, 2011 1:47 pm, edited 1 time in total.
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
RaverGames
Posts: 17
Joined: Sat Sep 25, 2010 8:54 am

Post by RaverGames »

@random_anonymouse

Pointcloud will render the Vertices of a SceneNode

Image
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

viceversa
Do you like VODKA???
Image
Image
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Post by pandoragami »

I tried to follow this tutorial http://irrlicht.sourceforge.net/phpBB2/ ... =primitive

and I got this code but theres no cube?

Code: Select all

#include <C:\irrlicht-1.7.2\include\irrlicht.h>


using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace gui;

/*
IrrlichtDevice* device = createDevice(EDT_OPENGL, core::dimension2d<s32>(640,480));

OpenGL - EDT_OPENGL
DirectX 8 - EDT_DIRECT3D8
DirectX 9 - EDT_DIRECT3D9
Software - EDT_SOFTWARE
Sofware 2 - EDT_BURNINGSVIDEO

IVideoDriver* video = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
*/
int main()
{
 IrrlichtDevice *device = createDevice(EDT_OPENGL);
 IVideoDriver* video = device->getVideoDriver();
 ISceneManager* smgr = device->getSceneManager();

 ISceneNode* cube = smgr->addCubeSceneNode();
 cube->setPosition(vector3df(0,0,0));

 while(device->run() && device)
 {
  video->beginScene(true, true, video::SColor(255,0,0,255));
  smgr->drawAll();
  video->endScene();
 }
}
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Yes there is no camera so you won't see anything ;)
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Post by pandoragami »

Yes there is no camera so you won't see anything
Oh! Well I guess he could've explained that part in the tut. I'm not sure how to add a camera, could you maybe hack my code to include one?


Nevermind, I just added

Code: Select all

smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
into

Code: Select all


#include <C:\irrlicht-1.7.2\include\irrlicht.h>


using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace gui;

/*
IrrlichtDevice* device = createDevice(EDT_OPENGL, core::dimension2d<s32>(640,480));

OpenGL - EDT_OPENGL
DirectX 8 - EDT_DIRECT3D8
DirectX 9 - EDT_DIRECT3D9
Software - EDT_SOFTWARE
Sofware 2 - EDT_BURNINGSVIDEO

IVideoDriver* video = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
*/
int main()
{

 IrrlichtDevice *device = createDevice(EDT_OPENGL);
 IVideoDriver* video = device->getVideoDriver();
 ISceneManager* smgr = device->getSceneManager();

 ISceneNode* cube = smgr->addCubeSceneNode();
 cube->setPosition(vector3df(0,0,0));
 smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));

 while(device->run() && device)
 {
  video->beginScene(true, true, video::SColor(255,0,0,255));
  smgr->drawAll();
  video->endScene();
 }
}

@RaverGames

Do you have any actual code that could help me. I see the point cloud idea better now although I'm lost with what method I use and what parameters are false, etc. A working example or snippet would be fine or just add a couple of lines to my code above, thanks
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can check out wireframe and point cloud in the terrain example of the SDK. Just press 'w' and 'p' to change modes.
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Post by pandoragami »

@hybrid

I compiled the source for that and it works but it only does wireframe and no point clouds. Is there a parameter in the code I change for that? What line?
janw
Posts: 13
Joined: Wed Aug 11, 2010 2:23 pm

Post by janw »

Code: Select all

case irr::KEY_KEY_P: // switch wire frame mode
				Terrain->setMaterialFlag(video::EMF_POINTCLOUD,
						!Terrain->getMaterial(0).PointCloud);
				Terrain->setMaterialFlag(video::EMF_WIREFRAME, false);
				return true;
at this point mate:), look at the tutorial first ( just a suggestion ) before posting such a questions;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Also note that not all drivers support point cloud rendering. IIRC, the sw drivers don't support it.
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Post by pandoragami »

@janw

at this point mate:), look at the tutorial first ( just a suggestion ) before posting such a questions;)


I didnt know about the tutorial before asking.


@hybrid

thanks it works now, used opengl though, thats the only driver that did work.
Last edited by pandoragami on Fri Jan 28, 2011 5:12 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What? How did you compile sources without knowing about it?
random_anonymouse wrote:I compiled the source for that and it works but it only does wireframe and no point clouds. Is there a parameter in the code I change for that? What line?
pandoragami
Posts: 226
Joined: Wed Jan 26, 2011 5:37 pm
Contact:

Post by pandoragami »

What? How did you compile sources without knowing about it?
I just compiled the sources I didnt look at the code itself. I also didnt know the terrain tutorial had point clouds.
Post Reply