|
|
More Ideas:
|
|
Visit Blog page [1/
2/
3/
4]
|
Now that I added multiple model support, I've been working on adding animation support for dark basic models again, but this time the proper way. I made the code easier to understand by separating header files into {matrix.h, vectorxf.h, materials.h, objects.h, models.h, animation.h, ui.h, and camera.h}.
Get the source here.

BTW, I added 3rd person camera support. The controls are a bit different too.
W -- MOVE CAMERA FORWARD
S -- MOVE CAMERA BACKWARD
A -- STRAFE CAMERA LEFT
D -- STRAFE CAMERA RIGHT
UP ARROW -- MOVE CAMERA UP
DOWN ARROW -- MOVE CAMERA DOWN
LEFT ARROW -- ROLL CAMERA COUNTER-CLOCKWISE
RIGHT ARROW -- ROLL CAMERA CLOCKWISE
F1 -- (DISABLED)
F2 -- DIAGNOSTIC MODES
F3 -- CYCLE BACK THRU SELECTED MODELS
F4 -- CYCLE FORWARD THRU SELECTED MODELS
F5 -- CYCLE BACK THRU SELECTED OBJECT
F6 -- CYCLE FORWARD THRU SELECTED OBJECT
F7 -- CYCLE BACK THRU SELECTED VERTEX
F8 -- CYCLE FORWARD THRU SELECTED VERTEX
F11 -- CYCLE BACK THRU SELECTED POSITION KEY
F12 -- CYCLE FORWARD THRU SELECTED POSITION KEY
J -- REDUCE SELECTED MODEL SIZE
K -- INCREASE SELECTED MODEL SIZE
B -- TOGGLE ENVIRONMENT ATTRIB PUSHING/POPING
N -- TOGGLE MATERIALS
M -- TOGGLE SINGLE/MULTIPLE MODEL MODE
L -- TOGGLE DISPLAY LISTS
Z -- TOGGLE BLENDING SOURCE MODE
X -- TOGGLE BLENDING DESTINATION MODE
1, 2, 3, 4, 5, 6, 7, 8 -- ANIMATION MODES
ESCAPE -- QUITS
|
Created a basic 4x4 matrix class (CMatrix16). I added common functions like matrix addition, matrix multiplication, matrix translation, and matrix rotation (still in progress). I aimed Translate to behave the same as glTranslatef, similar for Rotate. Download the source here.
Posted a forum question on matrix multiplication.
|
 |
Added the use of Display Lists and Vertex Arrays which boosted speed considerably.
Used the following functions:
{glNewList, glEnableClientState, glTexCoordPointer, glVertexPointer, glNormalPointer, glDrawElements}
Get the source here.
|
|
 |
Added a few new controls that allow you to cycle though each model. Here are the new controls.
's' -- Toggle single/multiple model mode
'a' -- Cycle selected model to top of list
'd' -- Cycle selected model to bottom of list
'j' -- Scale the model down by a factor of 1.1
'k' -- Scale the model up
Get the source here.
Posted a forum question on optimization.
|
|
 |
Increased the number of models you can load at the same time from 10 to 100. Added support so that each model can be scaled to fit the scene. The scene may run a little slow until I optimize it. I'm thinking about added Mesa3D support to handle software rendering for lower end cards.
Get the source here.
|
|
 |
I added support to load several (.3DS) models at the same time. Currently, the limit is ten, but you can increase the limit by increasing the model array size. I think this will make it easier to discover pivot solutions. AND each model can have multiple textures (not to be confused with multitextures).
Get the source here.
|
|
 |
The Sand Harvestor model works again when calculated on the fly. I added a few extra controls. To incorporate 4 different animation methods, I added 4 functions named similar to AnimateModel_Method_1. You can switch between these methods on the fly by pressing 1, 2, 3, 4, and 5, which are described below. Get the source here.
'1' -- Main Pivot Type -- supports test models 1-8, character & sandharvestor
'2' -- Translated Pivot Type -- supports test model 9
'3' -- Dark Basic Type -- works slightly
'4' -- Translated/Rotated Pivot Scenarios -- supports test models 10-13
'5' -- Apply no animation at all
|
|
I uncovered three different pivot methods. However, none of the three methods work for every case. It looks like the pivot options could be conditional. The conditions depend whether the pivot is {0,0,0}, or whether rotation keys are present, or whether some other condition exists. It looks like there could be more logic to flush out. The good news is that I know what the logic should be for a given model. All that remains is to discover how to make the logic work for every case. Check back soon.
|
 |
I spent the weekend trying to determine which plane pivots should use. The example "character.3ds" uses the {x, y, z} plane. I created a few tests with translated pivots similar to "trans_test09.3ds" which all seem to use {y, x, -z).
Get the source here and press the 'L' key to see the effect of switching between the two planes.
|
|
Added keyframer module support to calculate the following conditions on the fly:
(1) Translations and rotations applied to parentless objects.
(2) Grouped the objects from (1) without applying rot/trans to the first grouping.
(3) Grouped the objects from (1) with applying rot/trans to the first grouping.
(4) Grouped the group from (2) without applying rot/trans to the second grouping.
(5) Grouped the group from (3) without applying rot/trans to the second grouping.
(6) Grouped the group from (2) with applying rot/trans to the second grouping.
(7) Grouped the group from (3) with applying rot/trans to the second grouping.
(8) Grouped the group from (5) without applying rot/trans to the third grouping.
Get the source here. I plan to focus on custom pivots / axis locking next...
|
Spent the day working on getting grouped animations to work correctly. I started small. Parentless animations work. And now if you combine a parentless group into a single group without adding any animations to that, it should work too. Get the source here.
|
|
I updated the code for handling materials for ambience, diffusion, transparency, amoung a few others. I should get back to flushing out the animation code. Plus, I turned 25 today.
|
|
I added diagnostics for the bound box min and max chunks, which I've found are attached to group chunks. I'm not sure what kind of coordinates or scales are used for the bounding box, but it does look like the bound box information has nothing to do with the keyframer animations. I'm still working on getting the group hierarchy to display correctly when calculated on the fly. I thought the bounding box might hold a piece of the puzzle, apparently not. The source is going to be in two separate branches now. I'm doing some experimental work to understand the hierarchy better, so you can get that version of the source here. You can still get the earlier branch here, where this is the version that actually works the best.
|
|
As you are speeding towards the crash zone, launch a few dozen seakers ahead to stabilize the ice you are about to crash through. Otherwise, you might break through on impact and drown in freezing liquid. The seakers should penetrate the ice and form a lattice cushion that can support weight of the impact and your ship for an extended period.
Since Europa is small, it lacks an atmosphere. Therefore, parachute mechanisms will not slow your decent. If you do survive the crash, you'll need to secure air, food, and water for an extended stay. Use some of the dispatched seakers below to retreive oygen rich liquids or even salt-water ice. You'll need to devise a way to extract breathable air and drinkable water from the oceans of Europa. You'll have to protein sequence your own food from the extracted water and the CO2 you breath out. Construct a few hundred thousand ATP molecules from carbon and water to be consumed each day.
You will also need to setup a solar panel array to maintain heat and power. Large batteries are a must because this moon has short day cycles. Lastly, setup a communication beakon to send for help.
You could survive like this in your confined space for maybe six months at the most.
|
I made some architectural changes which reduce memory usage by calculating the keyframer animation keys for position and rotation on the fly. This replaces the earlier implementation of storing all 102 frames for each object with mostly null data. Currently, the rework only works for the character model. Still, other models should load without crashing. To get the latest source, click here.
|
Added a Sleep(1) routine which drastically reduces the required % CPU time using my ATI Radeon 64M card. My laptop really lags with 2 FPS using an old ATI 3D RAGE PRO LT 8M card. I added various FPS calculations that help maintain the desired FPS rates for camera and model updates. To get a new source update, click here.
|
Added DIAGSIZE1 and DIAGSIZE2 so that the size of the pivot spheres can be customized for each model. F2 now automatically toggles wireframe mode when using diagnostics. Cleaned up the PivotDiagnostics function to use glPushAttrib() and glPopAttrib(). Click here to get another source update.
|
|
I'm back to working on the 3DS animation code. I have a bit a psuedocode for a new approach that I'd like to try. We'll see if it works better. Here's the logic that I'm thinking could work.
---- Concept ----
Each keyframer object consists of a vertex mesh along with a set of translation and rotation keys. Since multiple rotations are involved along with a hierarchy, we can't simply add translations and rotations together. Until the exact logic is uncovered, we have to traverse the hierarchy each time we draw a keyframer object.
---- Implementation ----
/* Read 3DS File Chunks */
// Read object mesh vertex chunks
// Read object hierarchy and keyframer sets for positions, rotations, and scales. -- Store the data in vector lists.
/* Render Frame Animation Code */
// Push Current Drawing Matrix
// Increment Current Frame Number %mod% Total Number of Frames
// Recursively traverse hieracrachy to uppermost keyframer parent
// Increment current animation Frame Number for object until <= Current Frame Number
// Apply animation keys to drawing matrix while traversing back to keyframer object
// Pop Current Drawing Matrix
This project doesn't have a project page yet, but you can still get the source here.
|
|