Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  setting the camera in 3d racing game  (Read 2765 times)
0 Members and 1 Guest are viewing this topic.
Offline konieczny69

Senior Newbie

« Posted 2007-01-02 21:35:13 »


I am working on a simple 3d race game, i am using KeyNavigatorBehavior to move the car and I would need to have the car in the middle of the screen (just like in every race game) but I dont really know how to do it, could anyone help me out ?

regards, Lukasz
Offline Conzar

Junior Devvie

There is nothing common about common sense

« Reply #1 - Posted 2007-01-09 13:10:16 »

This post should help you out.

Offline Mr. Gol

Senior Devvie

Medals: 1

« Reply #2 - Posted 2007-01-14 13:51:04 »

I don´t really understand your problem. The way you have implemented the controls doesn´t really have anything to do with the camera. If you have an object that moves, regardless what is causing the movement the camera must move at the same speed in order to achieve the camera that is used in all racing games.

You´ll need to set the Transform3D of the camera to match that of the car, and then move it back a little (depending on how close you want your camera to follow it).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline konieczny69

Senior Newbie

« Reply #3 - Posted 2007-01-21 09:20:59 »

Conzar : thanks, will look at that

Mr. Gol : use of KeyNavigatorBehavior was just a general information. I tried a lot to get me unstuck however nothing worked for me. Yes, I do somehow need to connect my camera with the car unfortunatelly I dont have a clue how to do it. I ran a thread that sets camera's transform but its not being updated much enough so  I achieved a funny effect as if the camera was chasing me Smiley I would try to update camera's position in my own Behavior class if I didn't use KeyNavigatorBehavior, which I dont know how to modify Sad
Offline ravenger

Senior Newbie

« Reply #4 - Posted 2007-01-22 13:34:18 »

why don't you implement something like a scenenode tree? Then you can make a parent scenenode to where you can attach both the camera and the car. You can then make it so that if you move the parent node, it automatically moves all of the parents children aswell.

Pages: [1]
  ignore  |  Print  

hadezbladez (732 views)
2018-11-16 13:46:03

hadezbladez (370 views)
2018-11-16 13:41:33

hadezbladez (722 views)
2018-11-16 13:35:35

hadezbladez (185 views)
2018-11-16 13:32:03

EgonOlsen (2381 views)
2018-06-10 19:43:48

EgonOlsen (2535 views)
2018-06-10 19:43:44

EgonOlsen (1471 views)
2018-06-10 19:43:20

DesertCoockie (2135 views)
2018-05-13 18:23:11

nelsongames (1931 views)
2018-04-24 18:15:36

nelsongames (2614 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!