TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kelvin Loke
NA
22
0
Problem with LinearGradientBrush
Aug 30 2007 6:16 PM
Hi everyone, I´m having some problems with my code, the problem is I´m trying to paint some points in a Viewport, and this code only works if I paint points of each color. But what I need is this to work even if all the boxes are the same color, the problem is that the offset doesn´t work... can anyone help me? Thank you!!! Here´s the code: Point3D location = new Point3D(x, y, z); AddBox(mesh, location, // Location new Size3D(.02, .02, .02), // Size k // Color ); } LinearGradientBrush gradient = new LinearGradientBrush(); gradient.GradientStops.Add(new GradientStop(Colors.Red, 0.0)); gradient.GradientStops.Add(new GradientStop(Colors.Yellow, 0.5)); gradient.GradientStops.Add(new GradientStop(Colors.Blue, 0.75)); gradient.GradientStops.Add(new GradientStop(Colors.Green, 1.0)); Material material; material = new DiffuseMaterial(gradient); // constructs a DiffuseMaterial with the specified Brush property, in this case gradient GeometryModel3D geometry = new GeometryModel3D(mesh, material); //Creates a 3-D model comprised of a MeshGeometry3D and a Material. // This data won't change, so we can freeze it for a small perf win. geometry.Freeze(); model.Content = geometry; return model; }
Reply
Answers (
0
)
Problem with closing network stream from client
c# key press please some one must know