September 1, 2011

Xcode 4.1 and lion

Xcode 4.1 and lion

In my new series of post I decided to write something about xcode 4.1

clip_image002

and lion os that i use in next post.

Xcode 4.1 can use in snow leopard also but you should download deferent version

For snow leopard .From Xcode 4 you see great change especially in interface of program.

You can add library to program in 4 device orientations (portrait upside-down landscape left and right) without add any more code.

With new interface you can use deferent editor without leave of xcode .New editor help you to have easier programming. You can switch between editors with click on view and editor in toolbar.I don’t want explain more about xcode and lion because you can find them in apple site.

clip_image004I write this post because if you have problem in xcode and lion discuss it in comment of this posts. In next post you’ll see articles about location based game.

Bye for now and wait for your comments.

clip_image006

Read more »

August 5, 2011

about my blog new version and game and application

hi dear friends

sorry for my late in posting but i working in games coding and like to come to you with

new codes and app and games.

it is my pleasure to see your ideas and project for android and iphon and pc

and help you about it

wait for your comment
Read more »

September 1, 2010

my new game will be published

thanks for your comments ,

as soon as I'll  publish my java 3d  game

and some discussion about games and developing

  send your comment about that what you want from mobile game

and which games you like and  are you played games in mobile or no.

wait  for your comments
Read more »

August 22, 2010

codes for touch in iphone

Every user should control game easily. Game controlling can be doing with  keypress
or touch or device(in iphone and some device).Which one you like?In iphone or even
java you should use events for every user command .In  this article we  focused on
touch events and codes.

a touch can be occurred in interface that i discussed in previous article. For any touch
and interface you should define function and connection from interface to function.
if you want use button button have many touch event like touch cancel,touch
down,touch up inside and etc.With right click in button in mainwindow you’ll see
events, select one of them and connected it to window select function you create for 
button.like this image


For other part of windows you shoul add more code .A code like it can be use
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
}
with this code you can define point for your touch .
CGPoint  lastPoint;
and in part of program that you can use it for detect your finger.
CGPoint gamePoint = [touch locationInView:self.view];
you can get coordinates of point.
x=gamePoint.x;y=gamePoint.y
in next post we discussed detailed about game making and also i’ll add more source code.
Read more »

August 12, 2010

using interface in opengles(part2: functions)

In this parti’ll describe how you can run your interface on base of  game objects move.

Every code for running your game main windows,should be added in EAGLVIew class.

in opengles is better that you add more windows to games for performing menus and

games and etc but in this project it isn’t necessary .In project that we build before you

know that  ES1Rendere and ES2Renderer class have code for render engine in

opengles1 and opengles2 .All new Iphone device support opengles2.

Now we want control speed of colored box (see in previous project).we  add two lable

and  button to windows like this image

setspeedwin

Now we define two function increasespeed and decreasespeed and a lable with name label in EAGLView class.in EAGLView.h inside interface we add UILabel *label ;

then add

- (IBAction)increasespeed:(id)sender;
- (IBAction)decreasespeed:(id)sender;

after  interface definition Then linked two button + and – to them..Now we add some code in function .for example for decreasespeed function we add this code(is same for increasespeed )

   - (IBAction)decreasespeed:(id)sender {

label.text=@"increase";
    speed+=0.15f;
     [renderer setspeed:(speed)];
     [renderer render];// is necessary for seeing change

}

setspeed is function that should defined in ES1Renderer and ES2Renderer and

ESRenderer.in ES1Renderer and ES2Renderer after interface defination add

-(void)setspeed:(int)Speed; . do it for ESRenderer after @protocol defination.

Now in ES2Renderer.m and ES1Renderer.m add following code

-(void)setspeed:(int)Speed
{
    speed=Speed;
}

it is all you need. now see your app!

 

setspeedapp

Read more »

August 7, 2010

using interface in opengles (part 1)

in this tutorial  i’ll describe opengles template that using in game developing and add interface to it.You can use text and image and etc without any coding in iphone games.Just for more change in text and images in during  game you need coding. first we create new project in Xcode and select opengles template like this image

opengl  

then select name for project .i select “test” for my project you can select another.

Xcode opened window like this image for you that you see test project and folders of it.

testproject

As you see test have 6 folder (classes,shaders,other sources,resources,frameworks and products).In resource you can see MainWindow.xib (is main topic of post).Select window .You can add some text and images and other library .see this image

window

In opengles codes forced some change in main window after run it.With any code you

can change interfaces also .after run your program you can see this window like it.

labelopengl

i add label(my game 1)to opengles sample project that you see.you can chage font and size of text and others that you want.

Read more »

August 3, 2010

Introduction to iphone programming

Xcode is  best tool for Iphone and Ipad and Mac programming.You can used so
many interfaces  easily in programming and connect them to source as you
want also with simulator for test your apps.see here for more info.In this picture
you see xcode 3.2.3 ide with iphone sdk 4.0
xcode3.2.3

Every project in Xcode at last have one windows(or view) .In windows we can
add some library like button,label,slide and…For this purpose we should
expand resource folder in left sidebar and open MainWindow.xib or
MainView.xib .Interface builder tool opened and show a blank window.It is
same windows that you see in iphone app. next drag your library from right
side to your windows . If you can’t see library should select tool menu and
then library.
interfacebuilder
Now build and run your apps .In next post I'll describe opengles tempelete that
is best choose for create 3d games for Iphone .and show how using interface
builders and codes in Xcode. 
yourapp1
Read more »

August 2, 2010

come back with new article

sorry for my delay in updating . But i come back with new articles.this article

are about 3d game programming for Iphone.wait for more

iphone

image link

Read more »

May 11, 2009

blender and python and game

blenderis a free 3d open source code.in blender you can run a python code and access to object and rotate and scaled and transform
them .you can first make figure in poser and then import it on blender or 3ds max.for import any poser figure it is better to select unimesh demo in python script box and make a sample demo from figure and then import it to 3ds max or blender.then you can create a code like this

# Windows version
import Blender
import sys

obj=Blender.Object.Get()
print str(obj)
sys.stdout.flush()

and run it on blender.you can custumize code with loop and others and make a game with it
Read more »

April 29, 2009

python and animation

python is great scripting language for animation specially use in blender and poser.
with a python script you can control tools of this software and moving of object in this.when you want to make game with java you can run a script sample in blender or poser for test of your game in real 3d scene and then make a java code for it.you can download python ide from here
this is a picture of python shell ide

and this is a part of code for rendering frame of 1 until 10 and save their images
PoserFile.append("E:\\dawood\\movie\\movie1.pz3")
TargetDirectory.append("E:\\dawood\\movie\\run\\")
FramePrefix.append("Run")
StartFrame.append(0)
EndFrame.append(10)
this codes help you also making animation easier and faster and control animation scenes.
Read more »

April 26, 2009

3 steps for making animation

poser and 3ds max are two good software for making animation and game .Poser is a 3d figuring
software and 3ds max is known 3d design software .in 3ds max you can design your 3d object like
and export it as 3ds file and import it in poser .In poser after import of 3ds max file you can create
figure and move it between frame of 1 and your desired frame.for better learning see here. for using in mobile game you should have a low poly figure and export again object to 3ds file and in 3ds max export all of movie in m3g file or obj file.
it is explained in 3 steps here
1-make object in 3ds max

2-import it on poser


3-render for making animation in poser
Read more »

April 23, 2009

3d animation and game

from today i want change my blog topic from java game programming to 3d animation and game.
because a best way to make games is that make good animation and run it with code in java or other programming language .from today i start my work in this subject .
be wait...
Read more »

February 25, 2009

ultimate fight 3d java game

in this version you can fight as iran,us,german,france,spain,......in place iran us, france,china ....
watch it here


and download it from
http://www.esnips.com/web/ultimatefight

gamepicture1
Hosted by eSnips

Read more »

February 24, 2009

animation and sound in 3d games

for this purpose you should use synchronized function for synchronized animation and sound with

your events occurred when key pressing.for Synchronize any functions you should use synchronized word before you functions this function is used for play mp3 sound
public synchronized void playmusic(String file)
{
if(sound==0)
try
{
Player p = Manager.createPlayer(file);
p.setLoopCount(5);
p.start();
}
catch(IOException e)
{
System.out.println("Error in io : " + e.toString());
}
catch(MediaException e)
{
System.out.println("Error in media : " + e.toString());
}
}
you should add this function in function that you want played syncronized .
public void keypress()
{
playmusic(file);
}
for animation you can make any arbitary function like this
syncronized void animation()
{
x++;
group.setTranslation(x,y,z);
}
this function force to moving a group in x axis without stop!
this was a sample way for animation and sound in java 3d game.
Read more »

February 17, 2009

download ultimate fight 3d 0.1 (my new game)


sorry for my late. i worked in my new game.this is ultimate fight 0.1.this game is in testing and contain a one level and two player now but this will be enhanced as soon as.in this video you can see game in snaps.

watch it

and download it from here
download it
Read more »

October 18, 2008

sample tips in making mobile game:graphics 1

tips1:
When you making a mobile games you should know that you can't make full city or even building

and textured them.Because it forced to have bigger 3d models and some mobile device's(or all of

them!).In this case you can textured your desired city or building or...in sample plane or cube

and move camera toward them. in game it seems that you moved in real city or building but you

moved to image .Then you can add your game sample building and humans and creatures to other

side of pictures.like below


this is my video
Read more »

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 »

August 4, 2008

Advanced programming II: images and text

Advanced programming II: images and text

Now we want focusing on making better game. For better game we need some text for showing score and some images for maps and other thing and at last a better graphics for getting your game more reality .

In design of 3d models you need getting texture from building and objects that you want to use in game. Some texture maybe force to distortion your model and even maybe you can’t see anything. And of course more high graphics texture and models may not be seen well in some old phone. For example when you download this game for p990 sonny erricson you see a picture like it


But when you want to download it for k750 from same company (sonny ericsson) you will see some graphics problem and maybe even you can’t see some models in older phones.

Add text and images and some functions

You can add text and images to your games with Graphics class and bind Graphics3D to it .You should add text and images to graphics after bind it to Graphics3D . it is an example code

g3d.bindTarget(graphics,true,Graphics3D.ANTIALIAS|

Graphics3D.TRUE_COLOR);

g3d.render(_world);

g3d.releaseTarget();

graphics.setColor(0x990000);

graphics.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_LARGE));

graphics.drawString("corner", 90, 150,

Graphics.TOP | Graphics.RIGHT);


In first code we bind target graphics(from Graphics class) to g3d(from Graphics3D) and in second line we render my world class . After release your g3d object you can change your graphics object and add image or add text .For add text I use three line for set color and font and text.

Add images is like that and only you need add function drawimage and image object to your code.This image can be maps or character picture or other thing.You can add some function also to your program for controlling move of cameras or objects in your game.I add a sample code for this porpose.

if(y>-20)

Y=-20;

With this code camera will be stopped if it reached to left wall.In 3ds max wall y position was 20 and

Camera will be moved to Y with this code

camera.setTranslation(X, Y, Z);

You can see more in this project


download project
Read more »

July 24, 2008

Using pointer: download A sample pointer enabled killer game

I add a sample project for more discuss in light and cameras. it is only a camera moving in between walls(textures are from internet).I'll add gun and other effects to it in next time.You can also edit 3d model in way you want. This is my model in 3 direction:top,camera,left and perspective


This model have a camera and 3 light and you should draw your model on base of your camera(upper right picture) and if you want use another cameras also you should configure your model on base of them. In this model camera id is 14 and for loading camera in program this code is enough

Camera camera;

Camera=(Camera)(Myworld.find(14));

Camera position in this model is your person eye.You can move camera in every place with this code

m.setTranslation(x,y,z);

For example you can move it with pointer with this code

protected void pointerPressed(int x, int y) {

m.setTranslation(x,y,z);


}

Pointerpress is a function that invoked when a pointer pressed and x,y is pointer location in screen .You can say that when pointer pressed (x,y) location in screen camera can move.you can add image and text to game for this purpose also. In next post i add text and image to this project for getting better result from this project.

Download project

Read more »