Designing a 3d sphere in the 2nd circle on the screen

What are some rasterization algorithms that can simply project a 3D sphere into a pixel grid? I want to avoid beam casting. Essentially, given the 3d coordinate and radius, is there a quick way to create a 2d circle / ellipse on a pixel grid?

For example: a circle at a point (2,2,2) with a radius of 4 is projected into five pixels: p1 (2,0) p2 (0,1) p3 (1,1) p4 (2,1) p5 (1,2)

I have come across methods such as splitting pixels into particle systems, but I have not found a clear answer on how to do this.

thanks

+3
source share
6 answers

What projection do you have?

, . , , 3d, * . , , . , , , , .

*:

+1

100%. = ?

:

. , , . D3D, Windows ( ), , 3D- . obejct , Windows. ( ).

, , 3D- -1.0f 1.0f . , ,

0

, ( - ) - 4x4. , 3D- 4x4.

, .

0

, , . , ...

, , , . , (0,0,0) (0,0) . X - , Y , Z .

: . X Y , ! Z , , , .

0

cool, , , x, y x, y, z , . ?. , ?

0

, . , .

, (X = 0, Y = 0), (X = 0, Y = 0, Z = 0). (sX, sY, sZ) sR, - D ( ), (cX = sX * D/sZ, cY = sY * D/sZ) cR = sR * D/sZ. D/sZ.

This circle is a good approximation of the projection of the ball if the focal length (D) is large or the coordinates sX and sY of the sphere are close to zero.

0
source

All Articles