Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat May 26, 2018 6:28 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Animating 3D objects
PostPosted: Tue Oct 04, 2005 5:23 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
I will hopefully soon get to grips with working in 3D and stop having to ask a question every five minutes, but until then.

For animating a 3D Object, I understand that I can move, rotate and various actions on the object itself. But if I wanted to make a character walk, would I use the AddShape method and then when I need to I cycle through the shapes that I have added to that object?

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 6:58 am 
Offline

Joined: Fri Sep 30, 2005 11:19 am
Posts: 275
That's one way to do it, but if you want smoother animations, you should perhaps check out this:

"3D Animation Builder Alpha 3 for REALbasic

Download:
http://www.miensoftware.com/files/rb/rb ... uilder.zip

What's new?
- Copying now works
- Is now memory efficient by sharing everything except the vertex positions
- Can now easily copy subclassed Animation3D
- New FPS info in the Animation Builder to see how fast the animation runs
- Reordering of animation states in the Animation Builder
- Runs a bit faster
- Runs better in game
- Is now Windows compatible

Finally add animation to your RB games with ease! Uses only about 30-60% more RAM than a non-animating object

How easy?
1. Add the Animation3D classes to your project
2. Make sure the super classes of all the Object3Ds you want animated is a Animation3D
3. Load the animation you created using the Animation Builder by calling .LoadFromFile(f as folderitem)
3. Call the .UpdateAnimation(timepassed as double) in your game loop to update the animation
4. Call the Play, Stop, and SetAnimationState(name as string) methods to control your animation

Animation States:
SetAnimationState(name as string)
MorphToState(name as string, Duration as double)

Support for Level of Detail:
- Set the level of detail in game with the method:
SetLevelOfDetail LOD//1=High 2=Medium 3=Low

Checking the state of your animation:
- Animation3D.isPlaying as boolean
- Animation3D.CurrentAnimationState as AnimationState
- Animation3D.CurrentAnimationName as string
- Animation3D.CurrentAnimationIndex as integer

Playback options for AnimationState:
- AnimationState.isLooping as Boolean
- AnimationState.isReversed as Boolean
- AnimationState.isLoopBackAndForth as boolean
- AnimationState.SetPosition(Time as double)
- AnimationState.SetFrame(frame as double)
- AnimationState.FrameCount as integer

Cloning:
Animation3D.Copy as Animation3D

Cloning a subclass of Animation3D:
mySubclass(Animation3D.Copy(new mySubclass)) as mySubclass

To do:
- Support for multi texturing


Notes:
The 3D Animation Builder uses the MBS Plugin collection for the multi-folderitem dialog box. If you would like to modify the code, make sure you have the MBS plugin or remove that section of code and replace it with the standard single folderitem dialog box.

Author:
Lo Saeteurn
lo@miensoftware.com
http://www.miensoftware.com

Please do not use my sample zombie animation. It is only there for demonstration." - Lo Saeteurn on the RB Games mailing list

_________________
"If you look carefully at my lips, you'll realize that I'm actually saying something else."
Brainswitch Machina - REALStudio/REALbasic
RBScriptExtender - give RBScript power to work with any class


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 9:01 am 
Offline

Joined: Fri Sep 30, 2005 9:37 am
Posts: 32
Now that RB allows you to work with the models at the vertex level, perhaps we'll see some skeletal animation classes.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group