Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8565629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:28:11+00:00 2026-06-11T17:28:11+00:00

I am trying to animate a 3d mesh that chnages over time using trimesh

  • 0

I am trying to animate a 3d mesh that chnages over time using trimesh. On each iteration I draw the mesh. On some iterations I also change the camera position orientation etc. However the camera resets after plotting. I would like the camera position to stay fixed on further iterations. How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:28:12+00:00Added an answer on June 11, 2026 at 5:28 pm

    If you do a clf or cla anywhere, that also clears the axes’ camera* properties. You’ll have to save those and re-set them on every iteration:

    g = [];
    while ~done
    
        clf;
    
        ... %# generate mesh and other elements
    
        %# set previous Camera* properties
        if ~isempty(g)
            set(gca, g); end
    
        %# possibly adjust them for the current frame
        ...
    
        %# save all Camera* properties
        g.CameraPosition     = get(gca, 'CameraPosition');  
        g.CameraTarget       = get(gca, 'CameraTarget');    
        g.CameraUpVector     = get(gca, 'CameraUpVector');
        g.CameraUpVectorMode = get(gca, 'CameraUpVectorMode');
        g.CameraViewAngle    = get(gca, 'CameraViewAngle');
    
        %# Grab the current frame
        ...
    
    end
    

    Alternatively, you can save handles to all objects your create, and delete them on each iteration. AFAIK, this will preserve the axes’ properties:

    while ~done
    
        h(1) = trimesh(...)
        h(2) = patch(...)
        ...
    
        %# grab the frame
        ...
    
        %# delete all plot elements instead of clf/cla
        delete(h)
    
    end
    

    Haven’t tested this last one though, so you might want to do some experimenting with that first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to animate an UIImage view, each time by 90 degree clockwise. For
i m trying to animate a image on mouse over and i want that
I'm trying to animate some stuff using the usual UIView class methods. I'm calling
I am trying to animate a div when the user click the button. Each
I'm trying to animate a div so that when the page load it has
I am trying to animate my #main div so that it fades out and
I'm trying to animate the font size of some text: $(p).delay(500).animate({ font-size: +=50 },
I'm trying to animate a series of full screen images. Each image will be
Im trying to animate one elment after another, but I have some troubles with
I'm trying to animate an image so that it centers itself. Here's the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.