Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

drawing filled disk

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 giugio   Members   

246
Like
0Likes
Like

Posted 19 October 2012 - 12:54 PM

hello.
I have created a little engine in 2d in opengl for qt.
I Would create a system for create a filled disk and a rectangle(for now) of different color ,positioned at the mouse x,y when i click.
The question is :
1)How i can create the disk? with the sine/cosine and a step angle and for the fill? but is better on the shader(GLSL) or on the cpu ?
2)i wish parametrize the color for ex.
If i create a vbo with the color attribute every time that the color must change i must change the vbo.
Is not better using a uniform var with the color and matrixes for the scale/translate/rotate for the entities?

#2 Lauris Kaplinski   Members   

841
Like
0Likes
Like

Posted 19 October 2012 - 03:25 PM

1)How i can create the disk? with the sine/cosine and a step angle and for the fill? but is better on the shader(GLSL) or on the cpu ?

As you will have about 100 vertices max, there is no reason to do it in GPU - calculate the positions (via sin/cos) on the CPU and store in VBO

2)i wish parametrize the color for ex.
If i create a vbo with the color attribute every time that the color must change i must change the vbo.
Is not better using a uniform var with the color and matrixes for the scale/translate/rotate for the entities?

You are already at correct path Posted Image
Lauris Kaplinski

First technology demo of my game Shinya is out: http://lauris.kaplinski.com/shinya
Khayyam 3D - a freeware poser and scene builder application: http://khayyam.kaplinski.com/




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.