CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: .Net graphics

  1. #1
    Join Date
    Sep 2007
    Posts
    12

    .Net graphics

    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

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: .Net graphics

    It depends on what you want to change about the 2d image dynamically (which you do not mention).

  3. #3
    Join Date
    Sep 2007
    Posts
    12

    Re: .Net graphics

    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...

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: .Net graphics

    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.

  5. #5
    Join Date
    Sep 2007
    Posts
    12

    Re: .Net graphics

    I was afraid of that...

  6. #6
    Join Date
    Jun 2008
    Posts
    2,477

    Re: .Net graphics

    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.

  7. #7
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    37

    Re: .Net graphics

    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.

  8. #8
    Join Date
    Jun 2008
    Posts
    2,477

    Re: .Net graphics

    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.

  9. #9
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: .Net graphics

    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

  10. #10
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    37

    Re: .Net graphics

    Quote Originally Posted by BigEd781 View Post
    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 ...
    Quote Originally Posted by BigEd781 View Post
    and then simply blt'd to the screen.
    ... which is what I called 'copying to the image'.

    Or did I misunderstand you?

  11. #11
    Join Date
    Jun 2008
    Posts
    2,477

    Re: .Net graphics

    I don't get what you are proposing. You would write a custom routine for each image? That would be ridiculous...

  12. #12
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: .Net graphics

    you can always render a 3d model to a bitmap and render that.

  13. #13
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    37

    Re: .Net graphics

    Quote Originally Posted by BigEd781 View Post
    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.

  14. #14
    Join Date
    Jun 2008
    Posts
    2,477

    Re: .Net graphics

    Quote Originally Posted by hreba View Post
    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.

  15. #15
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    37

    Re: .Net graphics

    Quote Originally Posted by BigEd781 View Post
    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.).

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured