VRML surface conic projection

조회 수: 13 (최근 30일)
andre padilla
andre padilla 2020년 4월 7일
댓글: andre padilla 2020년 4월 12일
How can i do a conic projection of a surface in VRML format ?
  댓글 수: 6
darova
darova 2020년 4월 7일
Is this correct?
Do you know how the cone is situated?
andre padilla
andre padilla 2020년 4월 7일
Yes of course
i know where the cone is situated and what is its solid angle
and the distance from its top to the geometrical center of the surface
A+

댓글을 달려면 로그인하십시오.

답변 (3개)

darova
darova 2020년 4월 8일
Here is an idea:
  • Projection onto cone: if your data in cartesian system - convert it to polar ()
New radius of projected data
  • Create flat projection:
New limits of angle:
New limits or radius:
See also HERE and HERE

andre padilla
andre padilla 2020년 4월 11일
May be i did not sufficiently esplain the problem.
I generated in another software a colored surface of an arbitrary shape model (its not a sphere or an an ellipsoide ...)
This surface is in VRML 2 format.
I was wondering how it is possible to use a MATLAB function to generate a conic projection of this colored model surface.
Seems that existing MATLAB functions may produce conic projections of spheres or may be flatened spheroides
So these are not applicable for a random shaped objject. And one other problem is that those geographic MATLAB
functions do not read VRML format.
A+
  댓글 수: 3
andre padilla
andre padilla 2020년 4월 11일
Do you think that i can use this kind of strategy
MATLAB commands :
landareas = shaperead('landareas.shp','UseGeoCoords',true);
axesm ('eqaconic', 'Frame', 'on', 'Grid', 'on');
geoshow(landareas,'FaceColor',[1 1 .5],'EdgeColor',[.6 .6 .6]);
tissot;
Of course i have to convert
my_object_surface.wrl to my_object_surface.shp
How to do that ?
A+
darova
darova 2020년 4월 11일
Can you attach the data?

댓글을 달려면 로그인하십시오.


andre padilla
andre padilla 2020년 4월 11일
Yes of course.
the file need to be renamed to .gz and gunziped
A+
  댓글 수: 3
darova
darova 2020년 4월 11일
I uploaded this program to read your file: LINK
Inside the program i changed this line (someone in comments to this script did the same)
keynames=char('Coordinate','point','coordIndex','color');
Then used this script to import to MATLAB and make a projection
[nel,w3d,infoline] = read_vrml1('myscene.wrl');
%%
cla
pts = w3d(1).pts;
fv.vertices = pts;
fv.faces = w3d(1).knx;
patch(fv,'facecolor','g')
a = 60;
[X,Y] = meshgrid(-20:20); % grid for cone
Z = 40-1/tand(a)*sqrt(X.^2+Y.^2); % Z coordinate of cone
surface(X,Y,Z,'facecolor','none','edgecolor','y')
[td,rd] = cart2pol(pts(:,1),pts(:,2)); % convert data to polar system
L0 = rd*sind(a) + (40-pts(:,3))*cosd(a);
r0 = L0 * sind(a); % new radius
zd = 40-L0 * cosd(a); % new Z coordinate
[xd,yd] = pol2cart(td,r0,pts(:,3)); % conert to cartesian
fv1.vertices = [xd yd zd];
fv1.faces = fv.faces;
patch(fv1,'facecolor','r')
light
axis vis3d equal
Unfortunately i didn't find a way to import colors
Honestly: looks like
Is it you wanted? Or you wanted flat projection?
andre padilla
andre padilla 2020년 4월 12일
thanks,
that is a first way i will try to find to get the colors
Many thanks
A+

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by