필터 지우기
필터 지우기

Render an accurate image of 3D Moon

조회 수: 8 (최근 30일)
Mauro De Francesco
Mauro De Francesco 2019년 6월 28일
편집: Mauro De Francesco 2019년 6월 28일
I want to create an accurate image of a 3D Moon model as if it were seen by a camera. I am using a rendering software to compare the image resulting (POV-Ray).
I am using the code below to produce the image on Matlab and the result is
With POV-Ray, setting the same value for distance of the moon and radius I obtain
I obtain with Matlab a smaller Moon with respect to the POV-ray one and I am sure that there is some camera issue that Matlab does not take into account, do you know which one of it should it be?
% Create Moon Ellipsoid
[x, y, z] = ellipsoid(MoonCam(1),MoonCam(2),MoonCam(3),...
R_moon(1),R_moon(2),R_moon(3),2000); % Moon ellipsoid centered at MoonCam
% Init Figure
figure()
axis equal
hold on
% Plot Moon Triaxial Ellipsoid with textures
planet = surf(x,y,z,'Edgecolor', 'none');
moon = imread('moon.jpg');
set(planet,'FaceColor','texturemap','Cdata', moon,'BackFaceLighting','unlit')
% Camera Settings
set(gca,'CameraPosition', [0 0 0], ... % Position of camera at LUMIO center
'CameraTarget',MoonCam,... % Target of camera
'CameraViewAngle',6,... % Field of view of the camera
'CameraUpVector',[0 1 0], ...% Camera Up vector (y axis)
'Projection','perspective', ... % Projection of ccamera
'visible','off',... % Untoggle axis
'Color','k',... % Set background color of the rectagle to black
'xdir','reverse') % Set x-axis positive toward right
% Image settings
set(gcf,'color','k',... % Set all background to black
'PaperUnits', 'centimeters',... % Units in centimeters
'PaperPosition',[0 0 8.67 8.67] ); % Set Image to 1024x1024 pixels (or 8.67x8.67 cm)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Camera Views에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by