Polybezier() - How to draw a sinus/cosinus?

Windows specific forum
eriansa
Enthusiast
Enthusiast
Posts: 277
Joined: Wed Mar 17, 2004 12:31 am
Contact:

Polybezier() - How to draw a sinus/cosinus?

Post by eriansa »

title says it all.

i need the points coordinates.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

This help at all?

Code: Select all

OpenWindow(0,0,0,800,600,"",$ca0001)
InitSprite()
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0)

*points=AllocateMemory(2*4*4)
PokeL(*points,100);start
PokeL(*points+4,100)

PokeL(*points+8,300);control
PokeL(*points+12,20)

PokeL(*points+16,500);control
PokeL(*points+20,580)

PokeL(*points+24,700);end
PokeL(*points+28,500)
hdc=StartDrawing(ScreenOutput())
FrontColor(#White)
PolyBezier_(hdc,*points,4)
StopDrawing()

Repeat
Until WaitWindowEvent()=16
eriansa
Enthusiast
Enthusiast
Posts: 277
Joined: Wed Mar 17, 2004 12:31 am
Contact:

Post by eriansa »

Not exactly, the curve is not complete.

Perhaps a mathematical formula to calculate those points?
I am a math noob...
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Can you explain a bit better what you want, is it just a sin wave?
eriansa
Enthusiast
Enthusiast
Posts: 277
Joined: Wed Mar 17, 2004 12:31 am
Contact:

Post by eriansa »

Well, I thought there could be some mathematical function to calculate the points needed, to let the PolyBezier_() Api function draw an exact sine wave.

Sure I can start drawing and find the points more or less, but a function would be much easier :wink:
hellhound66
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Feb 21, 2006 12:37 pm

Post by hellhound66 »

Removed.
Last edited by hellhound66 on Wed Mar 19, 2008 11:40 pm, edited 1 time in total.
eriansa
Enthusiast
Enthusiast
Posts: 277
Joined: Wed Mar 17, 2004 12:31 am
Contact:

Post by eriansa »

Calculates Sin-values. Really.
Sure, but that's not the question :wink:
Post Reply