Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
curves and ovals
#1
How can I make curves and ovals? I know how to make circles, but I don't understand how I can make ovals and curves.
Not yet Snake! It's not over yet!
Reply
#2
CIRCLE can be used to draw curves. Look it up in QBHELP.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#3
Thats not a way of answering a question.

Heres an example:

Code:
CONST PI=3.141593
SCREEN 2
'Draw a circle with the upper-left quarter missing.
'Use negative numbers so radii are drawn.
CIRCLE (320,100), 200,, -PI, -PI/2
'Use relative coordinates to draw a circle within the missing quarter.
CIRCLE STEP (-100,-42),100
'Draw a small ellipse inside the circle.
CIRCLE STEP(0,0), 100,,,, 5/25
'Display the drawing until a key is pressed.
LOCATE 25,1 : PRINT "Press any key to end.";
DO
LOOP WHILE INKEY$=""

Thats borrowed from qb v7.1's help =P

Have a look at the aspect ratio part
Reply
#4
for curves, courtesy of myself and dav's lovely code post:
http://home.carolina.rr.com/davs/codepos...BEZIER.BAS

Bezier curves are curves based on 4 points, which draw a line between two of the points, and pulling towards the other two points. It's a pretty handy tool for systematic calculation of the curves. Shame you either have to use floating or fixed point decimal values to use it, though.
Reply
#5
lines and point-by-point drawing are definetly "better" than the CIRCLE command of QB.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#6
Quote:lines and point-by-point drawing are definetly "better" than the CIRCLE command of QB.

I totally agree. And GOTO is definitely "better" than SUB, right nyahaha Big Grin
Reply
#7
no.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#8
A faster way to calculate curves is to derivate it n times until it no longer has any variables with exponent. This means derivating twice with quadrics, three times with cubics etc. Then in the loop calculate the change as a series of additions.


dy = y(x + k) - y(x)
ddy = dy(x + k) - dy(x)

then
for i = 0 to steps-1
y = y + dy
dy = dy + ddy
next i

Simple really, but fast.
oship me and i will give you lots of guurrls and beeea
Reply
#9
Yeah, that's a good way to go about it Blitz. Except chances are no one is going to understand you until they've taken several Calculus courses and been programming for a few years. Smile
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#10
Aga, its not that difficult. Anyone with a basic understanding of calculus and i mean *understanding* not just the formulae can easily program it =).

The advanced stuff doesnt kick in until you are integrating 2D surfaces with double integrals and 3D with triple integrals =P. Thats 'hard' to understand. But its simple *if* and only *if* you have the knowledge of what an integral/derivative of a function *is*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)