convert 3d co-ords to 2d

Blitz3D Forums/Blitz3D Programming/convert 3d co-ords to 2d

cermit(Posted 2004) [#1]
How do i get the 2D co-ordinate from a 3D co-ordinate?
Any help apreaciated.


semar(Posted 2004) [#2]
Depends on which plane you need to convert.

If your characters move in a 3D world among the x and z axis, no matter which y they have, then all you need is to take EntityX(entity) and EntityZ(entity) value, and scale it accordingly with your 2D map.

It really depends on what do you want to map.

Sergio.


Rob(Posted 2004) [#3]
semar: huh? thats not very helpful...

Cermit:

CameraProject command will take a 3D coordinate and make it 2D for you.

CameraProject camera,EntityX(ent),EntityY(ent),EntityZ(ent)
X_2D = ProjectedX()
Y_2D = ProjectedY()


It's as simple as this. The 2D coordinates of the 3D entity called "ent" will be put into ProjectedX() and ProjectedY()


cermit(Posted 2004) [#4]
Ok thanks :) have a nice day!


martonic(Posted 2004) [#5]
Does anyone know a simple way to do the converse - that is, (without using trial and error) to determine 3d coordinates (say, at a certain distance from the camera) for which CameraProject will return a given x and y?


Zenith(Posted 2004) [#6]
camerapick()

and pickedx() y and so forth