Welcome To Darwinbots > Newbie

Darwinbots replacement/clone

<< < (10/11) > >>

peterb:

--- Quote from: Numsgil ---
--- Quote from: peterb ---Well i've done neither, so i will slowly learn it i guess.
--- End quote ---

Word of warning: if you've never done any OpenGL/XNA/DirectX before, and don't have a real good understanding of how graphics cards work...  Well, it's going to be difficult.  You're pretty close to the metal.  Basically video cards don't know how to draw anything but triangles.  So for drawing circles you have to either tessellate it (divide it up into triangles) or draw a square with a circle texture.  And there are a lot of ways to do something, only some of which are fast.

Did you see the GDI link I posted at the bottom of my last post?  It's built right in to .NET and I think it'll save you a lot of effort.  It's based more on the "draw circle at x,y pixel position" paradigm you might be used to.

--- End quote ---

I've seen the GDI sample, they remind me of the pen up and pen down commands of logo, which i never was a fan of..
I've been thinking too to use sprites for circles, that way no calculations..hmm
but they need to rotate as well, and scale not sure if that is something a graphic card does do fast.
Would it be better to scale, or to have multiple sprites of different sizes ?

Numsgil:

--- Quote from: peterb ---I've seen the GDI sample, they remind me of the pen up and pen down commands of logo, which i never was a fan of..
I've been thinking too to use sprites for circles, that way no calculations..hmm
but they need to rotate as well, and scale not sure if that is something a graphic card does do fast.
Would it be better to scale, or to have multiple sprites of different sizes ?
--- End quote ---

Yes, they use transformation matrices to handle scale, rotation, and translation of triangles.  Once the triangles are placed in screen space, they get their texture sampled and applied.

Textures/sprites have the advantage that they require fewer pixels.  But they'll get pixelated if you zoom in too close.  Using triangles will mean the edges won't be smooth, but will look more like a n-gon (eg: octagon) when you zoom in.

peterb:

--- Quote from: Numsgil ---
--- Quote from: peterb ---I've seen the GDI sample, they remind me of the pen up and pen down commands of logo, which i never was a fan of..
I've been thinking too to use sprites for circles, that way no calculations..hmm
but they need to rotate as well, and scale not sure if that is something a graphic card does do fast.
Would it be better to scale, or to have multiple sprites of different sizes ?
--- End quote ---

Yes, they use transformation matrices to handle scale, rotation, and translation of triangles.  Once the triangles are placed in screen space, they get their texture sampled and applied.

Textures/sprites have the advantage that they require fewer pixels.  But they'll get pixelated if you zoom in too close.  Using triangles will mean the edges won't be smooth, but will look more like a n-gon (eg: octagon) when you zoom in.

--- End quote ---

HMM

GL_Line_Loop

thinking of something fast to create n sides (its slow to do all with cos and sin) ,
basicly a quarter of a circle, or even maybe 1/8 is enough to get all X,Y positions ... hmm thinking fast routines no (zero) divisions and re-using values, and arrays.

peterb:
Numsqil what do you think of this :

idea for openGL

The more precize the circles are, the less circles you have to draw since the viewscreen is zoomed in..
So .. ideas get more complex, but also you dont have to draw anything outside the current viewscreen (speeding things up).
I'm not sure if the program needs to know what is inside the viewscreen (vb.net could be aware of that).
So a circle routine has to be aware of the zoom scale.


 for some simple math testing for this i'd like to have a... simple language to draw.. duh.

hmmm i'm beginning to wonder if c++ might be more easy for this all together, as might tackle to many problems at once.

Houshalter:

--- Quote from: peterb ---I've seen the GDI sample, they remind me of the pen up and pen down commands of logo, which i never was a fan of..
--- End quote ---
You mean turtle graphics? Whats wrong with them?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version