Painting with OGRE

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
iblues1976
Gnome
Posts: 379
Joined: Fri Sep 16, 2011 4:54 pm
x 10

Painting with OGRE

Post by iblues1976 »

Hello,

I realized that Ogre may not be first tool that comes to mind for a "finger" paint applications. I actually, I have done quite easy in C# and also in C++ with WinAPI. Nevertheless, In a current application that I have, I would like to have a "Paint" mode as I called it. This will allow the user to create strokes with multi-touch screen (or pen for that matter).

My question is how to go about this in Ogre. With OGRE, everything that I have done,it always consist of loading meshes. I know there is manual objects? is this how? can anyone provide a small snippet? really, I just want a line of a given thickness (it could be more like 3D trace) for each stroke... I already have all the input taken care of... I just need to know how to produce the output ...

Thank you!
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Painting with OGRE

Post by Klaim »

If you don't need the depths of 3D, I would suggest to use Cinder or OpenFrameworks for making interactive surface graphics stuffs like drawing (or Processing for non-C++ tools). They are basically designed to provide all the necessary shortcuts to get you quickly to the fun part that is . SFML could be used too but only with an addition of some tools.
I mean, these are the easieast tools for a C++ programmer for making a painting application.

But, they are also full frameworks (not SFML) which just take your code in to modify them.
If you actually want 3D and you need to do something that might be complex, then any flexible 3D engine that you can plug in your code will do. I use Ogre3D because I need the flexibility first. But I don't know if it match your needs.

If you are really asking about the "possibility" of doing drawing with Ogre, I think yes it's feasable because Ogre don't do anything particular to the rendering system, and what you want is to do something with it. Ogre will not help either by the way (while OF and Cinder will) so be warned.
Basically, if you want to draw on textures, look at dynamic textures code, but if you want to draw using geometry (which will still be displayed like a plan, for example using quads instead of pixels or something creative like that) then you will have to get creative. Maybe Ogre Procedural could help.
iblues1976
Gnome
Posts: 379
Joined: Fri Sep 16, 2011 4:54 pm
x 10

Re: Painting with OGRE

Post by iblues1976 »

Klaim,

Thank you for the answer.

I do understand that they are better options...

What I have with OGRE is a 3D enviroments... I just need for testing and other purposes, show the traces of the fingers in the 3D enviroments... Maybe mygui can provide something..

Mainly what I was asking maybe an example , code snippet that I could use to do this...

Thanks
amartin
Halfling
Posts: 87
Joined: Wed Aug 14, 2013 6:55 am
Location: Norway
x 13

Re: Painting with OGRE

Post by amartin »

Look in the wiki under cookbook for code snippets.

For what you are doing I would suggest you look at raycasting to polygon and shaders.

If I was doing this I'd create every object I wanted to draw on with a shader that had two textures. The first one is the original the second one is the drawn colours. Maybe look at the alpha mapping shader once you get comfortable with basic shaders it will use 2 textures already but do extra stuff you might not want.

Ray casting to polygon. You raycast from the touch find the polygon lookup the texture coordinates. Use those texture coordinates to update the drawing texture and then put it back into the entity that was hit.

I think that should get you going in the right direction and if it doesn't work it will at least give you an idea on what to do I think.
iblues1976
Gnome
Posts: 379
Joined: Fri Sep 16, 2011 4:54 pm
x 10

Re: Painting with OGRE

Post by iblues1976 »

It may be an overkill. But I will see what i can do. thanks

Has anyone else done this?
Post Reply