Message Boards Message Boards

Find the right angle of a shot (SNOOKER)

Posted 4 years ago
POSTED BY: Hans Dolhaine
3 Replies
POSTED BY: Henrik Schachner
Posted 4 years ago

You could use the option ViewAngle

g2 = Graphics3D[
    {Red, Sphere[obb, r], White, Sphere[cue, r]},
    ViewPoint -> vp, Boxed -> False, SphericalRegion -> True,
    ViewAngle -> 2.2 \[Degree]
];
POSTED BY: Hans Milton

This is perhaps somewaht better, but the original problem remains.

r = .2;
d = 1.5;
f = 1.2;
obb = {0, 0, 0};
obb2 = {0, 0};
ghb = {0, -2 r, 0};
ghb2 = {0, -2 r};

Manipulate[
 phi = (270 + w) Pi/180;
 cue = d {Cos[phi], Sin[phi], 0};
 cue2 = Take[cue, 2];
 vp = ghb + (cue - ghb) 10;

 g1 = Graphics[
   {Red, Disk[obb2, r],
    GrayLevel[.8], Disk[cue2, r],
    Black, Circle[ghb2, r],
    Black,
    Line[{cue2, obb2}],
    Arrow[{obb2, {0, 1}}],
    Arrow[{cue2, ghb2}],
    Dashed, Line[{ghb2, obb2}]
    },
   PlotRange -> {f {-d, d}, f {-d, d}}
   ];

 g2 = Graphics3D[
   {
    Red, Sphere[obb, r],
    White, Sphere[cue, r]
    },
   ViewPoint -> vp,
   Boxed -> False,
   SphericalRegion -> True
   ];

 GraphicsGrid[{{g1, g2}}, ImageSize -> Large],
 {w, {-70, -60, -45, -30, 0, 30, 45, 60, 70}}, ControlType -> Setter]
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract