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

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
todaben
Posts: 1
Joined: Tue Apr 18, 2017 7:10 pm
Location: Gray, Maine, USA

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

Post 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.
Tod
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

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

Post 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.
"this is not the bottleneck you are looking for"
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post 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).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply