[1] modeling software (such as 3D Max) to model static objects and dynamic characters in a game scene.
The game table and studio logo in the lower right corner are modeled using 3DS Max
Poker table:
Sign:
[2] Based on the Phong illumination model to achieve real-time illumination of the scene.
Two light sources are used in the game:
A stationary, non-directional light source placed in the same position as the camera;
A moving spotlight, which tracks the movement of the mouse, has the following effects:
It can be seen that the object is illuminated by the part of the mouse that passes through it (the mouse is not displayed).
In terms of code, using Osg::light and Osg::lightsource to specify the light source, part of the spotlight code is as follows:
Light2_obj =NewOsg::light;light2_obj->setlightnum (1 ); Light2_obj->setambient (OSG::VEC4 (0.5,0.5,0.5,1.0)); Light2_obj->setdiffuse (OSG::VEC4 (1.0,1.0,1.0,1.0) ); Light2_obj->setspecular (OSG::VEC4 (1.0,1.0,1.0,1.0) ); Light2_obj->setposition (OSG::VEC4 (0.0f,0.0f,0.0f,1.0f) ); Light2_obj->setspotexponent (1.0); Light2_obj->setspotcutoff (45.0); Light2_obj->setdirection (OSG::VEC3 (0.0,10.0,0.0)); Osg::ref_ptr<osg::LightSource> LightSource2 =NewOsg::lightsource; LightSource2-setlight (light2_obj); Light2=NewOSG::P ositionattitudetransform;light2->setposition (OSG::VEC3 (0.0,0.0,0.0)); Light2->addchild (LightSource2.Get() );
[3] The use of basic texture mapping technology to enhance the realism of the game scene.
As can be seen from the above, the objects in the game are basically using texture mapping.
In addition, I have assigned material information for each object to achieve some special lighting effects, such as the following self-luminous effects: (red card in the picture)
[4] Based on skeletal animation or key frame animation technology to achieve character animation.
The key frame animation implemented by the finite animation machine is adopted.
For example, during the player's hand-out process, the animation machine specifies three key points on the moving path:
The point at which the card is selected, the point at which it is selected (15.5,2.2,0.5), and the two keys (depending on the card type) on the path where the card is played when it is selected.
When the player has entered the corresponding input operation, the card will automatically move to the destination along the specified path.
The sample procedure is as follows:
1. Check Cards
2. Click on the selected card again to perform the card action
3. Cards are played
[5] Collision detection.
When the card is played, due to its destination row (shown in yellow box) may have a previous card (shown in the blue circle) to block its motion path, each card should be played to detect whether it has hit the front of the card, if hit the stop, did not hit continue to move until the previous card hit. The results of the card movement are as follows:
[6] concave and convex texture mapping.
The game table uses the bump texture technique, can see the more obvious effect.
Having a concave-convex texture:
Only diffuse textures:
Normal mapping: (drawn using Nvidia's Photoshop plugin)
Use osgfx::bumpmapping to achieve this effect.
Quint Card online--Some of the techniques used by the client