unity – Geometry shader vertex position to point at camera

I have a shader that takes an array of points. At each point, a geometry shader creates a quad oriented towards the camera.

This works fine when the camera and point are at around the same Y value, however, looking up/down upon the billboard results in it shrinking to a point the closer the camera approaches being directly above/below.

Example (Youtube)

void geom(point v2g IN(1), inout TriangleStream<g2f> triStream) {
    // Calculate some vectors
    float3 up = float3(0, 1, 0);
    float3 look = _WorldSpaceCameraPos - IN(0).position;
    look = normalize(look);
    float3 right = cross(up, look);

    // And how far off-centre our corners are
    float halfS = 0.5f * IN(0).colorScale(1) * _Scale;

    // Calculate verts
    float4 v(4);
    v(0) = UnityObjectToClipPos(IN(0).position + float4(+halfS * right - halfS * up, 1.0f));
    v(1) = UnityObjectToClipPos(IN(0).position + float4(+halfS * right + halfS * up, 1.0f));
    v(2) = UnityObjectToClipPos(IN(0).position + float4(-halfS * right - halfS * up, 1.0f));
    v(3) = UnityObjectToClipPos(IN(0).position + float4(-halfS * right + halfS * up, 1.0f));

    // pass through color texture lookup
    float2 color = float2(IN(0).colorScale(0), .5);

    // Start pushing verts
    g2f o;
    o.position = v(0);
    o.color = color;
    o.uv = float2(1.0f, 0.0f);


I’m guessing my issue is related to the fact that my up and look are approaching coincidence, as the forward derives directly from the camera and the up is in world space, however, I’m uncertain of my diagnosis and unclear on how to generate an appropriately rotated up?

differential geometry – Critical points of the moment map

Let $(M,omega)$ be a symplectic compact connexe manifold endowed with a hamiltonian action of a torus $T$. Let $mu : M longrightarrow {Lie(T)}^*,$ be the moment map associated to this action.

We say that a point $m in M $ is critical point of $mu$, if $T_m mu : T_m M longrightarrow {Lie(T)}^*$, the tangent map of $mu$ is not surjective.

How can one prove that the above definition of critical points of the moment map $mu$ is equivalent to the following statements:

(1). $m in M $ is critical point of $mu$ if and only if the stabilizer of m, stab(m), contains a sub-torus of T of dimension 1.

(2). The tangent map $T_m mu$ is not surjective if there exists an element $X in Lie(T)-lbrace 0 rbrace$, such that $langle T_m mu, X rangle = 0$.

Any feedback would be appreciated.

geometry – Volume of polygon-based pyramid

I read in a book a few months ago that the volume of a (solid) pyramid with a base that is ANY polygon (I’m not sure if it mentioned it being regular or not) is equal to
$$frac{1}{3}times Atimes h$$
where $a$ is the area of the base (ie of the polygon) and $h$ is the height of the pyramid.

This seems to be true in many cases, such as when the base is a square, a triangle and when the base is a circle (ie the pyramid becomes a cone).

My question is, how can we prove this? I simply have no idea.

Thank you for your help.

ag.algebraic geometry – How I can get a sequence for differential sheaf on the one point blow-up of $mathbb{P}^2$?

Let $X:=mathbb{P}^2$ and let $pi : Y(:=mathbb{Bl}_p) rightarrow X$ be the blow-up of $mathbb{P}^2$ at a point $p$. Then we can get a exact sequence for the differential sheaf $Omega_Y^1$ of $Y$ as :
$$0 rightarrow {cal{O}}_Y(-2f) rightarrow Omega_Y^1 rightarrow {cal{O}}_Y(-2h-f) rightarrow 0$$
In the above sequence $f$ is a fibre of ruling(as seen $Y$ is a ruled surface), while $h$ is the negative intersection section. My question is that how I can get this sequence in detail. Maybe it is an easy question, but I cannot get any idea for the first step. Thank you for your help.

What is the name of this geometric structure; is it a flat Cartan geometry?

If you consider hyperbolic $3$-space $H^3$, modeled by the open unit ball in $mathbb{R}^3$, then given any two distinct points $x_1$, $x_2$ in $H^3$, there is a natural way of identifying the unit tangent spheres $S_{x_1}$ and $S_{x_2}$ at $x_1$ and $x_2$ respectively. Start at $x_1$. Given a unit tangent vector $v$ at $x_1$, draw the geodesic ray starting at $x_1$ with initial velocity $v$, and define $f_1(v)$ to be the ideal point which is the limiting point of that geodesic ray. Then $f_1: S_{x_1} to S_infty$ is a diffeomorphism from $S_{x_1}$ onto the sphere at infinity.

Similarly, one may define the diffeomorphism $f_2: S_{x_2} to S_infty$. Then the composition $f_2^{-1} circ f_1$ is a naturally defined diffeomorphism from $S_{x_1}$ onto $S_{x_2}$.

Now if we think of each unit tangent sphere as “rolling” onto $H^3$, then if we roll the sphere along two different paths joining $x_1$ to $x_2$, then at the end we will end up with the same “sphere configuration” at $x_2$, so to speak. Thus, if I am not mistaken, this defines a flat Cartan geometry, where the principal fiber bundle is a sphere bundle (in this case topologically trivial).

I am a bit rusty on Cartan geometry (which I never studied sufficiently carefully), but am I right that this is an example of a flat Cartan geometry modeled on the conformal $2$-sphere? Could someone please write an answer with some more details perhaps?

Edit: in a Cartan geometry, if a manifold is “modeled on G/H”, then in particular its dimension must be that of $G/H$. But this is not quite the case in this example. Indeed, $H^3$ is $3$-dimensional, while each conformal sphere is $2$-dimensional. I am not yet sure what is the relevant notion that this example naturally belongs to.

ag.algebraic geometry – Connectedness of smooth locus in $mathbb{P}^n_{mathbb{C}}$

For $ m in mathbb{N},$ let $ U_{m} = { ( a_{i_0i_1…i_{n}}) hspace{1em} | hspace{1em} 0 neq P_m = sum_{_{i_{0}+…+i_{n}=m , i_r geq 0}} a_{i_0i_1…i_{n}} X^{i_0}_{0}X^{i_1}_{1}…X^{i_n}_{n} $ and $V(P_m)$ is smooth }$ subset mathbb{P}^{ m+n choose n}_{mathbb{C}}.$

Is $U_m$ connected ?

dg.differential geometry – Is there a metric on Euclidean space that turns the Helmholtz equation into the Laplace equation?

Is there a Riemannian metric $tilde g$ on $mathbb R^d$ such that
Delta_{tilde g}=e^f(Delta +1),$$

for some $fin C^infty(mathbb R^d)$? Here $Delta=partial_{x_1}^2+ldots+partial_{x_d}^2.$

If there is such a $tilde g$, it cannot be conformal to the standard Euclidean metric $g=delta_{ij}$. Indeed, if $tilde g = e^{2phi}g$, then
$$Delta_{tilde g} = e^{-2phi} left(Delta + (d-2)g^{ij}frac{partial phi}{partial x_j}frac{partial}{partial x_i}right),$$
and either $d=2$, or the second summand in the round brackets is constant only in the trivial case $nabla phi=0$. In both cases (1) cannot be satisfied.

geometry – MariaDB ERROR 1048 GeomFromText returning as null

I am trying to restore a databese from an old server onto a new server and my geomertry columns are not importing


UPDATE `property_floor` SET
`floorBounds` = ST_GeomFromText('MULTIPOINT((115.823402 -32.064224),(115.823509 -32.079125),(115.843336 -32.064224)')
WHERE `floorID` = '1'

Error in query (1048): Column ‘floorBounds’ cannot be null

I have tried it both with the SRID and without it. tried both ST_GeomFromText and GeomFromText

I am at a loss for what is wrong, Is this a bug? is my data malformed (looks good to me, but I could be having one of those blind moments) or has something changed?

floorBounds is of type multipoint and the data I am trying to import was exported from a functioning database.

mariaDB version 10.3.25-MariaDB-0+deb10u1

I only just noticed that the old server WAS NOT using mariaDB but MySQL (ver 5.7.31-0ubuntu0.16.04.1) But it should still be compatible, correct?

ag.algebraic geometry – Application of a general uniform position theorem

A general version of the uniform position theorem on p. 113 – 114 of ACGH states the following:

Let $C subset mathbb{P}^r$, $r ge 3$, be an irreducible, non-degenerate, possible singular, curve of degree $d$. If $mathcal{D}$ is any linear system on $C$, and $Gamma = H cap C$ a hyperplane section general with respect to $mathcal{D}$, then all subsets of $m$ points of $Gamma$ impose the same number of conditions on $mathcal{D}$. Equivalently, if $Gamma’ subset Gamma$ is any subset which fails to impose independent conditions on $mathcal{D}$, then every divisor in $mathcal{D}$ containing $Gamma’$ contains $Gamma$.

Just to clarify, does “general with respect to a linear system” mean that subsets of hyperplanes $(mathbb{P}^r)^*$ imposing a smaller number of independent conditions form a strictly closed subset of the subset imposing $ge m$ conditions? If so, does a similar statement apply to linear subspaces of complementary dimension for higher dimensional varieties? I tried to find a more precise statement in other sources, but most of the resources that I found tend to deal with hyperplanes whose intersection with $C$ are linearly independent and don’t involve more precise information about the number of independent conditions.

dg.differential geometry – Eigentensors for Lichnerowicz Laplacian on CP^n

Consider the Lichnerowicz Laplacian arising in the study of the stability of Einstein metrics:

$Delta_L h_{ij} := nabla^* nabla h_{ij} + 2 R_{i p j q} h_{pq}$.

I am interested to know, on $mathbb {CP}^n$, as explicitly as possible, the first eigentensors for this operator. My understanding is that the answer is in the 1980 paper of Koiso, “Rigidity and stability of Einstein metrics…,” although it is (to me) a fairly abstract exercise in representation theory. Is it possible to describe these eigentensors in a more explicit way? As a further question, do any of these eigentensors have a nontrivial invariance group?