Page 1 of 1

Porting a simple scene from three.js - Where to start

Posted: Tue Apr 18, 2017 7:37 pm
by todaben
I need to port an application that is currently (mostly) running under three.js to a more robust platform.

I have looked through the examples but not found anything that addresses simple points, lines, and shapes. My application allows viewing a large static data set and being able to use a mouse to select a specific point or line and see the associated information. I have already prepared the data files. I also use an OSM map .jpeg as the floor.

Where would I find some examples?
What are the names of the classes I should be looking at?
What terms should I be using if mine are not specific enough?
Are there tutorials or videos on the subject?

I think I have the event handler example. The examples seem to be working on my system.

A few pointers in the right direction would be greately appreciated.

Re: Porting a simple scene from three.js - Where to start

Posted: Tue Apr 18, 2017 8:37 pm
by Cube_
[quote] points, lines, and shapes. [quote]
For lines you could draw debugging lines from raycastasts I guess, for points... a very short debug line maybe? Or possibly a billboard texture - as for shapes, if they're 2D just use a texture or construct a 2D polygon from vertices manually and draw that

anything fancy would require raw D3D or OpenGL[1], luckily that's not very hard.

[1] well that's what my decaffeinated brain tells me, so take that with a pinch of salt.

Re: Porting a simple scene from three.js - Where to start

Posted: Tue Apr 18, 2017 8:46 pm
by CuteAlien
On the lowest level you can use IVideoDriver::drawVertexPrimitiveList. That allows passing basic primitives like lines and points to the graphic card. You have to set a tranformation and some material first like:

Code: Select all

 
        driver->setMaterial(someMaterial);
        driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
 
Beside that Irrlicht doesn't have that much support for things like points and lines, the focus is more on 3d meshes.

Generally taking a look at IVideoDriver interface might be a good starting-point in your case. It's the lowest level in Irrlicht - wrapping directly around the hardware drivers (like OpenGL and Direct3d).