Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Draw Black Circle

  1. #1

    Draw Black Circle

    Hi ...

    I have a Freeform with texture, and I want draw black circle on that Freeform, How can I do that :?:

    I don't wanna create plane and give it texture and put it on that Freeform , I realy want draw on that texture of Freeform .

    Please help me

    Thank you very much

  2. #2
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Draw Black Circle

    for each pixel
    If dist to pixel from the center (or any x,y) < threshold
    Pixel = Black
    else
    DoNothing;

    This will draw a filled circle.
    NecroSOFT - End of line -

  3. #3

    Draw Black Circle

    Please could you put an example or Code for doing that

    thank you ops:

  4. #4
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Draw Black Circle

    for x := 0 to Image.Width do
    for y := 0 to Image.Height do
    begin
    Dist := Sqrt((x * x) + (y * y));
    if Dist < 50 then
    Image.Pixels[x, y] := clBlack;
    end;

    This will draw a 1/4 circle in the left-top corner with a radius of 50. I did this from my naked mind, I didn't try the code, but I think you should be able to make something out of it.
    NecroSOFT - End of line -

  5. #5

    Draw Black Circle

    thank you NecroDOME

    I'll try with this code

  6. #6

    Draw Black Circle

    sorry NecroDOME :cry:
    but I couldn't do anything with that code, please help me with another code

  7. #7

    Draw Black Circle

    Just asking for another piece of code won't help you. I guess we need to see your code before we can help you.

    Did you allready try to draw a line on your texture, or just make a few pixels black. That would be a good start. If that works, you can use NecroDome's code to make that 1/4 circle, which is your next step.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  8. #8
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Draw Black Circle

    Maybe you should consider to start easy. I gave a simple piece of code most ppl understand. I'm willing to help, but I aint gonna write you a program.
    NecroSOFT - End of line -

  9. #9

    Draw Black Circle

    actually I want to make a shooter game , and I want to draw black circle for the sign of the bullet on the wall , I usually create transparent plane with texture and put it on the wall , but when I shoot quickly the game become very slowly specialy when the player move and when I stop shooting the game come back to the normal speed,
    so I want to change my way to another one , and I found that drawing black circle is the best way . the code you put it to me was very good but I didn't know how could I use it specialy the code work with X and Y and I need Z too
    that is my probelm ,is there any thing can help me or another idea to make the sign of the bullet

  10. #10

    Draw Black Circle

    Ah.. you want "decals" to appear on the walls when hit by a bullet. Did you allready figure out how to find the corrent position for the circle to appear (I think it's line/plane intersection)?

    Another tricky thing is that if you use the same texture for alot of different walls, all the walls will show this black circle.

    I'm sorry but i can't help you with this, because i never have done this myself and i never used GLScene.

    You should search the forums (or google) with "decals" and you should find some articles on how to make them. I don't want to discourage you, but it might be way more difficult than you think.

    Good luck with it. I really hope you can make this work.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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