Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drawing a simple cuboid ??
Message
De
22/03/2003 08:48:23
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
22/03/2003 08:41:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00768890
Message ID:
00768896
Vues:
18
Jos,

I'm impressed... I had time on my hands to answer, but it must have been "lazy" time as I didn't go the extra mile to do the coding. Then again, it's only early morning here and I've just barely gotten some coffee...

Renoir


>Albert, since I clearly have too much time on my hand below is a qik and dirty solution using VFP line drawing command. You could put this in a custom form property and call it with your x,y, and z values.
>
>You need to make sure that (a) your x and y origin is in the desired place on the form and (b) that your x,y, and z lengths can fit in the form area desired. You might need to test for this and scale the lengths to fit within your desired area.
>
>You could also optionally define line drawing colours and styles first.
>
>
>*
>* Draw a cuboid given an x,y, and z length in pixels
>*
>
>
>* Setup x and y origin - bottom left coordinate
>
>nXorg=200
>nYorg=200
>
>
>* Default x,y,z values of cuboid for this example.
>* Probably pass these as your cuboid x,y,z pararemeters
>
>nXlen=50
>nYlen=50
>nZlen=50
>
>
>* Calculate x,y values by which to displace second rectangle by nZlen
>
>nXdis = SQRT( ( nZlen^2 ) / 2 )
>nYdis = nXdis  && assume 45 degree perspective so x displacement = y displacement
>
>
>* Draw the cuboid
>
>WITH THISFORM
>
>
>  * First rectangle
>
>  .Line( nXorg,nYorg,nXorg+nXlen,nYorg )
>  .Line( nXorg,nYorg,nXorg,nYorg-nYlen )
>  .Line( nXorg,nYorg-nYlen,nXorg+nXlen,nYorg-nYlen )
>  .Line( nXorg+nXlen,nYorg,nXorg+nXlen,nYorg-nYlen )
>
>
>  * Second rectangle
>
>  .Line( nXorg+nXdis,nYorg-nYdis,nXorg+nXdis+nXlen,nYorg-nYdis )
>  .Line( nXorg+nXdis,nYorg-nYdis,nXorg+nXdis,nYorg-nYdis-nYlen )
>  .Line( nXorg+nXdis,nYorg-nYdis-nYlen,nXorg+nXdis+nXlen,nYorg-nYdis-nYlen )
>  .Line( nXorg+nXdis+nXlen,nYorg-nYdis,nXorg+nXdis+nXlen,nYorg-nYdis-nYlen )
>
>
>  * Joining lines between two rectangles - bottom
>
>  .Line( nXorg,nYorg,nXorg+nXdis,nYorg-nYdis )
>  .Line( nXorg+nXlen,nYorg,nXorg+nXlen+nXdis,nYorg-nYdis )
>
>
>  * Joining lines between two rectangles - top
>
>  .Line( nXorg,nYorg-nYlen,nXorg+nXdis,nYorg-nYlen-nYdis )
>  .Line( nXorg+nXlen,nYorg-nYlen,nXorg+nXlen+nXdis,nYorg-nYlen-nYdis )
>
>
>ENDWITH
>
>
>
>>Hello everybody !
>>
>>In my application i have have show some data from a measuremet system (roboter)
>>I will receive hight, width and depth from a cuboid and among some other things
>>i have to draw this cuboid in my form.
>>But how to do ????
>>Does anyone know a simple, free activex component that can handle this.
>>Just passing the three values to the componet and draw the cuboid in
>>my form ???
>>I don't need zooming, rotation ....
>>Any simple idea is welcomed.
>>
>>Best regards
>>Albert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform