hi im not sure where to put this.
these are my local coordinates of 1 of my triangle points
and this is how project the 3d coordinats on to a 2d plane
using my mouse i will add three points to the screen ,how do i turn these screen coordinats
into local coordinats or is there a better way other than local coordinats?
thanks
these are my local coordinates of 1 of my triangle points
Code:
With ONEobject
.LocalCoord(0).X = -1
.LocalCoord(0).Y = -0.5
.LocalCoord(0).z = 2.5
End With
Code:
Private Sub LocaltoScreen()
Dim lngIncr As Long 'counter
Dim tempcoord As Point3d 'buffer to hold temporary converted coordinates
With ONEobject
For lngIncr = 0 To .NumVertices
'converts local coordinates into world ones relative to the supplied Canvas
tempcoord.X = .rotatedLocalCoord(lngIncr).X + .CenterofWorld.X
tempcoord.Y = .rotatedLocalCoord(lngIncr).Y + .CenterofWorld.Y
tempcoord.z = .rotatedLocalCoord(lngIncr).z + .CenterofWorld.z
'now we project the 3d coordinats on to a 2d plane with perspective
.ScreenCoord(lngIncr).X = (tempcoord.X * HPC / tempcoord.z) + HCW
.ScreenCoord(lngIncr).Y = (-tempcoord.Y * VPC * ASPECT_COMP / tempcoord.z) + HCH
Next ' LNGINCR
End With 'ONEobject
End Sub
using my mouse i will add three points to the screen ,how do i turn these screen coordinats
into local coordinats or is there a better way other than local coordinats?
thanks