Click to See Complete Forum and Search --> : .Net graphics


Stonehead
September 30th, 2009, 02:52 PM
I need help with this.
In some games, you can modify face of your character using sliders (Fallout 3, Oblivion etc).
I would like to create similar effect using 2D graphics and .Net (well.. not face obviously, but simply to be able to alter graphics to some extent). I thought of using vector graphics and then adjusting properties of vectors but I don't know if that's even possible.

Ideas, suggestions, readings etc?

Thanks :)

BigEd781
September 30th, 2009, 04:02 PM
It depends on what you want to change about the 2d image dynamically (which you do not mention).

Stonehead
September 30th, 2009, 04:26 PM
for instance a dog.. a slim dog, a fat dog, shorter legs, longer legs, thicker legs, thiner legs, bigger eyes, smaller eyes, some coloring on the fur for instance...

BigEd781
September 30th, 2009, 04:31 PM
Perhaps someone else around here knows more about this than I do, but if you are working with 2d graphics you will really need to have different sprite sheets which represent all of the different legs, arms, faces, etc. 3d models can be manipulated, but 2d graphics are simply pixels. You could do some of your own image processing, but it would not work with different images (i.e., you could write a function that slims down the legs of dog A, but it likely will not work with dog B) and it would require more effort than it is worth.

Stonehead
September 30th, 2009, 04:55 PM
I was afraid of that...

BigEd781
September 30th, 2009, 05:55 PM
Yup, welcome to the world of 2d graphics :). I make 2d games in my spare time and the hardest part for me is finding graphics that fit my needs.

hreba
October 1st, 2009, 11:27 AM
I am not really expierienced in that area, but I would do the following:

- parametrize all graphical elements (e.g. length, width, color of a dog's leg)
- write drawing routines for them
- for user feedback on change: create slider events which redraw the graphical elements
- for performance: use the drawing routines to create bitmaps, and copy them to the image during the game instead of recalculation.

Hope it helps.

BigEd781
October 1st, 2009, 12:42 PM
I don't think that it would be practical to write your own routine for drawing these graphics. The graphics will have to be pre-made and then simply blt'd to the screen.

MadHatter
October 1st, 2009, 07:04 PM
those sliders adjust distortions to a mesh which is a pretty basic part of what 3d games are (animations & such do this too). coloring is adjusting a texture color on the model, again another simple thing.

doing this in 2d will either require you drawing out each sprite programatically, or switching sprites.

good luck

hreba
October 1st, 2009, 07:15 PM
I don't think that it would be practical to write your own routine for drawing these graphics. The graphics will have to be pre-made
... with a drawing routine which calculates the graphics element from the actual parameter values and draws it into a bitmap ...
and then simply blt'd to the screen.
... which is what I called 'copying to the image'.

Or did I misunderstand you?

BigEd781
October 1st, 2009, 07:19 PM
I don't get what you are proposing. You would write a custom routine for each image? That would be ridiculous...

MadHatter
October 1st, 2009, 08:04 PM
you can always render a 3d model to a bitmap and render that.

hreba
October 2nd, 2009, 08:30 AM
I don't get what you are proposing. You would write a custom routine for each image? That would be ridiculous...

No, I said that I would write a custom routine for each parametrized graphics elements such as a dog's leg.

BigEd781
October 2nd, 2009, 12:00 PM
No, I said that I would write a custom routine for each parametrized graphics elements such as a dog's leg.

But if you are dealing with 2d graphics you cannot just expand and contract various parts and expect everything to look correct. The shading will need to change, outlines, etc.

hreba
October 5th, 2009, 08:08 AM
But if you are dealing with 2d graphics you cannot just expand and contract various parts and expect everything to look correct. The shading will need to change, outlines, etc.
If you want to handle variations due to perspective distortions, than we are talking about projection of 3D objects on a plane and one would use something like the suggestion of MadHatter. But the original question was about 2D and the variation of a face, what I interpreted as its expression (lucky, sad etc.).

Stonehead
October 6th, 2009, 12:01 PM
Face manipulation was just an example of a simmilar idea. Dog example is closer to what I need.