Here is an example to start with,
This is the simplified code in here.
n = size(topomap1,1);
topo = (topo - min(topo(:))) ./ range(topo(:));
I = ind2rgb(round(topo*(n-1)+1), topomap1);
[X,Y,Z] = sphere(n);
for i = 1 : n
[az,el,r] = cart2sph(X,Y,Z);
az = az + 2 / n * pi;
[X,Y,Z] = sph2cart(az,el,r);
axis equal off
You can change I
The problem is the other general a click event handler running first
and scrolling to its href target before the top-specfic one. This
means when you click top, it will scroll down to itself and then up to
The best way to handle this is to have the top element at the top of
the page, such as <div class="container-full" id="top"> so that
you don't need two different event handlers a
You're most probably rotating before you translate. This will rotate
the entire coordinate space and your "translation along the x axis"
will actually be something completely different.
In future, make sure you translate, scale, then rotate. This way each
transformation will do what you intend without being manipulated by a
prior transformation. I suggest you look into matrices, coordinate