2008年11月29日 星期六
cWiiMote
i'm not sure if inside that sample is the same as wat Rock trying to do...cos i do not have the adapter with me at home...so i jus posted in up here....and hopefully i can try it in sch....
but...rock....if that's the same as wat you're doing...then inform me la~~~
2008年11月23日 星期日
Swing action graph
I do the swing action 3 times and get the at-graphs on right-hand side. The time is from right to left. The amplitude is the accelration of the sensor
The procedure is that first I need to hold the wiimote vertically and then swing it down. Therefore the red line should be higher than others before the action. The peak-value of the red line should be the swing effort.
The half-cycle of the Red is the time used for the action.
The value of X,Z mayuse to calculate the angle of the swing action.
Then I do it one more time with horizontal swing, the result is similiar, only the shape of X and Z line is exchanged.
2008年11月22日 星期六
Wiimote and WiimoteLib
The motion of the remote is sensed by a 3-axis linear accelerometer with the direction like the picture shown.
Calibration
The zero points, and gravity values, for the three accelerometer axes, are stored near the start of the Wiimote's flash memory.
Rumble
Rumble is provided via motor with an unbalanced weight attached inside the Wiimote which can be activated to cause the controller to vibrate.
Speaker
The Wiimote has a small low-quality speaker, used for short sound effects during gameplay.
Speaker is unavailable in WiimoteLib becuase of unknown format.
WiimoteLib
If you wish to use multiple Wiimotes, instantiate a WiimoteCollection object, call the FindAllWiimotes method to initialize it, and then use each individual Wiimote object in the collection as a separate instance.
WiimoteCollection wc = new WiimoteCollection();
wc.FindAllWiimotes();
foreach(Wiimote wm in wc)
{
wm.WiimoteChanged += wm_WiimoteChanged;
wm.WiimoteExtensionChanged += wm_WiimoteExtensionChanged;
wm.Connect();
wm.SetReportType(InputReport.IRAccel, true);
}
Data can be retrieved from the API in two ways: events and polling. In event mode, one must subscribe to the WiimoteChanged event as shown above. Then, when data is sent from the Wiimote to the PC, an event will be posted to your event handler for processing in your application. If you elect to not use the event model, you may simply retrieve state information at any time from the WiimoteState property of the Wiimote class.
Report Types
The library currently supports only a handful of the many report types the Wiimote is capable of producing, however the ones that are implemented are enough to get all required data for the Wiimote and all current extensions. Specifically, these reports are:
- Buttons - Button data only
- ButtonsAccel - Button and accelerometer data
- IRAccel - Button, accelerometer and IR data
- ButtonsExtension – Button and extension data
- ExtensionAccel - Button, accelerometer and extension data
- IRExtensionAccel - Button, accelerometer, extension and IR data
The report type can be set by calling the SetReportType method using the appropriate report type and whether or not you would like the data to be sent continuously or only when the state of the controller has changed.
Extensions
There are currently three Wii extensions supported by the library: the Nunchuk, the Classic Controller, and the Guitar Hero controller. If you wish to use these, you must setup an event handler for the WiimoteExtensionChanged event. When this event is called, you can check the event argument to determine if an extension was inserted or removed, and what type extension was inserted. In this event handler, you will need to change the report type with the SetReportType method to one that supports extension data, otherwise the data will not be returned to you.
2008年11月20日 星期四
intermediate progress-programming part
1. successful to import models with animation
2. character can move, jump on the map
3. simulated a rolling star
4. created a third-person view camera
incomplete task:
1. setup a restricted area which not allow the player go in
2. attach the rolling star on the character's hand
3. communication between wiimote and XNA
4. wiimote gesture recongition
5. communication between player and npc
6. attack on the monster
7. AI on the monster
8. questline
9. Portals transfer between maps
10. save/load game
11. xml content writer & reader for XNA(import gamedata through xml)
12. collision between player and objects(include npc,buildings)
13. still thinking...
failed....
so i declare....using of Blender - FAIL...
i will put my focus back to the programming then....
so sorry once again...................
2008年11月13日 星期四
2008年11月11日 星期二
A little good news
Today I research on rope simulation for our Rolling Star and find a good tutorial(link)
I have written the rope simulation into a C# version. The result is quite satisfied.
Basically, we just need to set the number of nodes and the physic property when construct.
Then we need to adjust the applyForce by vector to make it move.
Here is the video I took:
The action on Rolling is not perfect. We need to improve it later.
2008年11月8日 星期六
2008年11月6日 星期四
2008年11月5日 星期三
2008年11月1日 星期六
Animation Test
However, I find a new one which called "XNAnimation" support XNA2.0
I have tested it with my character class and it work. I import its demo model and it can really "run" on the floor with animation.The library supports cross fade between animation clips and keyframe interpolation.
But there is a problem that the library have 2 version
For version 1, it support PS2_0A (pixel shader) . It is better than PS2_0 but it doesn't support for our fyp computer which only support PS2_0.
For version 2, it updated a little bit. It support PS2_0 but some method are disabled
And it seems that if we change the library version or computers during development, the model will have some bad changes. I will do some more tests to confirm whether it's a problem or not.