September 15, 2008

step2:rotation object in game

you can rotate your object in 2 way.Which way you select is in base of your games and

algorithms and graphics of your programs.In first way you can set origin in game by

setOrigin function or like it.prerotate and postrotate function invoke this origin on

base of your origin and object default origin and make new origin.( see here for technical

information) This way is used when you want change your rotation origin on base of your game

algorithm and you havn't any fixed origin for your objects .But you can set your orotation origin in3d model maker software's and export it m3g.it is better using mascot capsule because some

exporter maybe can't export your origin and will be using default origin. For this porpose in 3ds



max 2008 for rotate leg on base of its upside


first in command panel we select hierarchy(third box from left)


then select pivot button and click on affect pivot only and then you can see small pivots.it is your




rotate or move or scaling origin you can move it to your desired picture and then click on align to
object only button in below now you can rotate your objects in new origin in model and game.
you should export this model to m3g with tool that i said before or another good tool and use it in game




Read more »

September 5, 2008

steps in making real 3d game

1.moving
moving of objects in 3d game is an important step in games and you should have good control in moving light and cameras .Camera position is on base of your game strategy and your game algorithm.for example in this test game(i'm still beginner) I set camera position with this code.
cam.postRotate(45, 0, 1,1); cam.setTranslation(xpos+40, ypos-50, zpos+60);
and you'll see camera in front of girl and above of her head when she moving near house.
in this video you will see how camera move(xpos,ypos,zpos is girl position in 3d place)



another method for moving is using transformation and transform matrix . a transform matrix is a 4 X 4 matrix and in java code you write it as float array with this code
float[] matrix={1,0,0,sx
,0,1,0,sy
,0,0,1,sz};



Transform m=new Transform();
m.set(matrix);
now for moving camera and human in x axis(1 unit) set sx=1 .If you have mesh with name human and camera you need only to this code for moving them.
camera.setTransform(m);
human.setTransform(m);
With setting sy and sz you can moving in y and z axis

.Matrix transform is very good for rotation and scale also. In next post i show how you can moving human with rotate hand and leg and body.This game also need a sample algorithm for moving girl .

You can download game for playing from this link
download
(sorry for some problem in exit and speed it was my first game)
Read more »