-
Emulating Writing on Surface
Hi all
I'm interested in emulating writing on a surface. My current idea:
i) map a blank texture onto a plane
ii)use a mouse to explore the surface
iii) where the mouse is (when button pressed), the pixel on the surface will be changed to a chosen colour.
Questions:
i) is this possible?
ii) is there such thing as a canvas in openGL?
iii) any suggestions on how I can achieve this?
Regards
-
Senior Member
OpenGL Pro
Re: Emulating Writing on Surface
Can you explain what "emulating writing on a surface" means? And what do you mean by "canvas"?
-
Re: Emulating Writing on Surface
You can can change rectanglular areas of an existing texture via glTexSubImage2D(), even single pixels.
So just update the texel where the mouse cursor is. The texel coordinate you have to calculate yourself, OpenGL won't do it for you.
But i'm not sure if i understood the question...
-
Re: Emulating Writing on Surface
Its actually similar to paint applications. You can free write on the screen.
I just want to create a simple application that can write something on a plane by using mouse interaction.
-
Senior Member
OpenGL Pro
Re: Emulating Writing on Surface
In this case I would "draw" on a texture and submit the dirty regions via TexSubImage and subsequently displaying the texture on the screen.
-
Re: Emulating Writing on Surface
What parameters does texsubimage take? Coordinates?
-
Re: Emulating Writing on Surface
-
Re: Emulating Writing on Surface
i shall give it a try but I'm still new in textures
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules