www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/17/10:30:26

From: "Arthur" <arfa AT clara DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: 3d sphere
Date: Sat, 17 Oct 1998 15:26:58 +0100
Message-ID: <000c01bdf9da$32867020$764e08c3@arthur>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
In-Reply-To: <362815A3.6A2C@club-internet.fr>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

> If you are not speed dependen, make two loops:
> loop b=0° to 180°
>  loop a=0° to 180°
>   ribbon=cos(b)
>   offset in ribbon=cos(a)
>   screenpos= (a,b)
>
> offcourse you have to multiply a and b with different konstants,
> bependin on how many ribbons you have, how big they are and the size of
> the sphere on screen.
>
> cos(a) and cos(b) witt ossilate between -1 and 1 so if you want a screen
> x-size of 100, make screen_x=cos(a)*50+50;
>
> Hop it helped(and hope it works, BTW, ordinary sin() and cos() works
> with radians, radians=degrees*pi/180 so use sin(a*3.1415/180) etc).

Remember that for a circle, you only need to calculate one quarter of it,
since the other four quarters are simply mirror images of the first quater.

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019