help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applying texture map of image to object using Octave 5.1 error


From: RT
Subject: Applying texture map of image to object using Octave 5.1 error
Date: Tue, 5 Mar 2019 14:19:44 -0500

Applying texture map of image to object using Octave 5.1 error
The error I'm getting is "error: invalid value for array property "cdata" "

I'm not sure which property I can use with cdata to map a texture

%example code below.
clear, clc, close all

%texture mapping test

% import image
original = imread('imported_image.jpg');
imshow(original)

%% Plot a sphere
[X,Y,Z]=ellipsoid(0,0,0,10,10,10);

figure()
surf(X,Y,Z)

%%map the image as a texture to the sphere
h=findobj('Type','surface'); %h is a handle
set(h,'CData',original,'FaceColor','texturemap')

I'm following an example found at https://youtu.be/djYowG_ITwk

--


reply via email to

[Prev in Thread] Current Thread [Next in Thread]