how to plot a 3d ship with random intensity values?
이전 댓글 표시
close all;
clc;
x=[0 50 50 0 0 0 50 50 50 50 50 50 0 0 0 -20 0 0 -20 0 0 15 35 35 15 15 15 35 35 35 35 35 35 15 15 15 15 20 30 30 20 20 20 30 30 30 30 30 30 20 20 20 20];
y=[0 0 5 5 0 -2.5 -2.5 0 -2.5 7.5 5 7.5 7.5 5 7.5 2.5 -2.5 0 2.5 5 7.5 7.5 7.5 -2.5 -2.5 7.5 7.5 7.5 7.5 7.5 -2.5 -2.5 -2.5 -2.5 -2.5 -2.5 7.5 7.5 7.5 -2.5 -2.5 7.5 7.5 7.5 7.5 7.5 -2.5 -2.5 -2.5 -2.5 -2.5 -2.5 7.5];
z=[0 0 0 0 0 5 5 0 5 5 0 5 5 0 5 5 5 0 5 0 5 5 5 5 5 5 10 10 5 10 10 5 10 10 5 10 10 10 10 10 10 10 15 15 10 15 15 10 15 15 10 15 15];
plot3(x,y,z);
This is the program i wrote for plotting a 3d ship. I need to generate random values of intensities for all the 25 coordinates and need to plot the ship with corresponding intensities............someone please help me out. hope somebody will respond soon.......thank u
댓글 수: 4
Azzi Abdelmalek
2013년 2월 22일
편집: Azzi Abdelmalek
2013년 2월 22일
Which variable represent intensities?
Image Analyst
2013년 2월 22일
I think those must be the (x,y,z) coordinates of the ship and each pixel is "on" at that 3D location. So if you did a surface rendering of the shapes, the sides of the thing would all be one solid color (blue).
Rajesh Thattikonda
2013년 2월 23일
Muthu Annamalai
2013년 2월 23일
You just have 25 points, each with x,y,z co-ordinates, and just create a
points = [x,y,z]; %25 x 3 matrix
intensities = rand(25,1); %25x1 col vector.
Does this answer your question?
채택된 답변
추가 답변 (1개)
Image Analyst
2013년 2월 22일
0 개 추천
Have you tried patch()?
댓글 수: 2
Rajesh Thattikonda
2013년 2월 23일
편집: Rajesh Thattikonda
2013년 2월 23일
Image Analyst
2013년 2월 23일
I never use patch myself. I'd have to figure it out just as you would. Can't you follow examples in the help or search the Answers forum for other ways people have used it.
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!