ReneMiner
04-11-2012, 18:51
My problem today is the following:
(OK, I could have appended this to the bound-array-thread, but it's not about arrays in general. pray for the day that I have no problem and help solving other tB-users problems instead, but that might come since I use thinBasics just a few days but that about 18 to 30 hours per day ;) )
I'm currently creating a simple 3d-drawing app.
since the subarrays in UDT's are not dynamic, I use a few arrays, so there's
-one dynamic array for colors (type TBGL_tRGB)
-one dynamic array for the Normals(UDT, 3 doubles x,y,z)
-one dynamic array for the Vertex-positions , same type as normals
-one dynamic for the triangles (large UDT, consists of 3 arrays to store the indices for color ,normals and positions and a few states)
-plus four long variables to store the array-element-count of all that,
-and one string that is the name of the picture.
My brain is totally used to capacity with handling 3d-rotations, translations, matrices and ordering triangles , so I have no idea to solve this:
I need to create an Undo/Redo-function so the user can restore old conditions of his 3d picture, consisting of the above described elements. It should save a few states so user can go a few steps back and redo also.
It will have a few days of time until it comes to coding that, but it will...
has anybody some smart idea how to store and retrieve all that in correct order? I just know the point in my code, where I have to create a new Undo-state...
(OK, I could have appended this to the bound-array-thread, but it's not about arrays in general. pray for the day that I have no problem and help solving other tB-users problems instead, but that might come since I use thinBasics just a few days but that about 18 to 30 hours per day ;) )
I'm currently creating a simple 3d-drawing app.
since the subarrays in UDT's are not dynamic, I use a few arrays, so there's
-one dynamic array for colors (type TBGL_tRGB)
-one dynamic array for the Normals(UDT, 3 doubles x,y,z)
-one dynamic array for the Vertex-positions , same type as normals
-one dynamic for the triangles (large UDT, consists of 3 arrays to store the indices for color ,normals and positions and a few states)
-plus four long variables to store the array-element-count of all that,
-and one string that is the name of the picture.
My brain is totally used to capacity with handling 3d-rotations, translations, matrices and ordering triangles , so I have no idea to solve this:
I need to create an Undo/Redo-function so the user can restore old conditions of his 3d picture, consisting of the above described elements. It should save a few states so user can go a few steps back and redo also.
It will have a few days of time until it comes to coding that, but it will...
has anybody some smart idea how to store and retrieve all that in correct order? I just know the point in my code, where I have to create a new Undo-state...