Jul 25, 2008

Opengl Matrix Translation Issues - having trouble with my 3D game.

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > Game Programming

free web hosting

Opengl Matrix Translation Issues - having trouble with my 3D game.

switch
hey

i'm making a game, and just went to implement collision detection when i found that it would be incredibly difficult because of a shortcut i added to work around a problem. now i'm going back to fix that problem, but i'm running out of ideas.

i'm trying to do this... (in c++)
CODE

xPos = (whatever); //the x and z coordinates of the object.
zPos = (whatever);
rotation = (whatever); //the rotation of the object in degrees.

glPushMatrix();
   glTranslatef(xPos, 0, yPos);
   glRotatef(rotation);
   renderObject();
glPopMatrix();


and draw an object at xPos,0,yPos with a rotation of 'rotation'.

instead, the object appears at xPos, 0, -yPos. the problem can be fixed by putting doing this for the translation:
CODE
glTranslatef(xPos, 0, yPos);
and until now this is what i was doing, but it makes things like collision detection and camera work much more complicated later on.

does anyone have any ideas on why this would be occuring and/or how to fix it?

thanks, muchly appreciated.

 

 

 


Reply

switch
ok sorry that post was riddled with problems. zPos (in the second line of the first block of code) should be yPos, and the second block of code should read
CODE
glTranslatef(xPos, 0, -yPos);


ok thanks sorry about that.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : opengl, matrix, translation, issues, trouble, 3d, game

  1. Google Talk Translation Bots
    (0)
  2. Make An Online Game To Earn Money
    Mainly for students (2)
    Hi im New but i have discoverd a way to make money its quite simple /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />. I always wanted to make my
    own game then i heard of mc codes i downloaded it and it took me about 2 months to setup /ohmy.gif"
    style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" /> , Yup it took me long because
    this was my first time editing script and im still a newbie cant blame me im only 15 /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> any way i made money....
  3. Java Game
    (2)
    Hi, I'm interested in game creation on websites. The game should be playable via web browser.
    I'm not new in programing, I know C++, C# and OpenGL api. But I'm new on Java. So I have
    some questions I want to ask You: Will I'l be able to create simple 2d game with java which
    would be playable via web browser? Simple 2d game means: timers, images, animated sprites, in game
    font. Will I'l be able to use OpenGL? Or I should use something different? Does Trap17 suports
    java graphics features I want? Thank You for Your time and answers.....
  4. What Game Are You Playing Now?
    (4)
    Come on guys share the game are you playing now, and a few points on what you found interesting in
    the game. Right now I'm playing NFS Pro Street, this game has excellent graphics and for the
    first time in the NFS series comes with damage effects. I'm still missing the adrenalin rush
    from NFS Most Wanted. Next I'm planning to play Gears of War, Call of Duty 4 and Time Shift....
  5. Come Play Criminal-life!
    Its a cool new game! (2)
    I am here advertising a game that was made a little while back and is in the early stages of
    development! So come play with us! It is a fun community, and is almost very active. With
    your help you can help us become very active! Click here to play Criminal-Life! Thanks
    all!....
  6. What Game Is This?
    What game is this? (2)
    Quick question what game is this ? or who makes it anyone can answer this please? /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> thanks
    http://i131.photobucket.com/albums/p320/ch...armi/sp84_1.jpg ....
  7. My New Game
    What Do You Think? (7)
    My Game what you think?....
  8. What Would Life Be Like Without Game Consoles/handhelds?
    We always ask this question about computers, so why not Games? (12)
    We always ask what life would be like without computers, but did we ever stop to think what our life
    would be like if the other stuff we took for granted wasn't here anymore? There are
    practically thousands of things that our life might feel empty without, so maybe we should start
    asking this question for those things too? I know there are a lot of Gamers out there, some of
    which couldn't last a minute if they didn't have their PS3 or XBox 360 or whatever console
    they have within standing distance of them. And I know there are many of you who are not so ha....
  9. Ea Announced Their Worst Idea Ever
    Install a game 3 times and then you have to buy another copy (9)
    I can't believe how stupid EA can be. So if you buy a game and install it over 3 times, it locks
    up and you have to buy another copy. This is STUPID. I've read in a forum a post by someone who
    formats his hard drive every 3 months. He's never going to buy any EA game with that kind of
    protection. I think it's pretty dumb too. Imagine buying the game, installing it and having it
    corrupted after a month or so. You get to fix it, re-install the game then it breaks down
    completely. Then you buy a new HD and you install it. What happens if you for some reaso....
  10. Text Based Rpg Game Maker
    (3)
    Well I need one, if you can help please do...I would like it so I can have people play online.....
  11. Favorite Sports Game...
    (5)
    What is your favorite sports game/franchise. I think Madden. I mean it sounds a bit like you
    don't play them saying Madden but they really keep bringing them out. Plus, I can just use one
    game and trade players to get teams for the next year /biggrin.gif" style="vertical-align:middle"
    emoid=":D" border="0" alt="biggrin.gif" />....
  12. Metal Gear Solid 4: Guns Of The Patriots
    Will it be THE BEST GAME EVER?? What do U think? (7)
    First of all Hello every one /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> I'm new there and this is my first post:) I'm a great fan of MGS
    series. Less than 330 houres from the time that i'm writing this txt one of my great dream will
    come true... 12th June is the day of worldwide premiere of METAL GEAR SOLID 4 . Do U think that
    this game can get the title of " Big Boss " of all games this genre? I really like to know your
    opinion /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ....
  13. A Game In The Works, Still Need A Name
    (4)
    So i'm at it again.. Heres what i have so far. Tech Items All tech armors will have bonus
    armor points Bonus armor points are to be used as one time hit points Some have more armor
    points, some have more abilities possibility of chance to avoid armor locations, for com penalty
    Speed Burst bonus scatter vs lob bonus to charge Reroll Hit armor Ranged Deflection Miss
    chance armor Misschance x means +(D(2x) -x) to defense Clone armor Misschance + lesser attack
    bonus(using misschance formula) Shocking Burst Set damage attack Jump Bonus to sc....
  14. Slavehack
    An online hacking GAME. (3)
    I found this game about 620 days ago whilst surfing for some *cough* stuff *cough* on the internet,
    i thought hey why not play it it can't harm me, but i was wrong, this game has taken over 600
    hours of my life away due to the addictingness of it. It's hard to get the hang of (or it was
    then because of the missing process page and the no tutorial), but now its easy. To
    'survive' in the game you need a nice set of software (currently the max is 5.0 when i
    started it was 1.5) to achieve this software you have to do riddles, once you've completed the
    ri....
  15. Game Dev Team
    Aim: to get a team together to develop an fps with scope to go mmo (4)
    Hey i'm new to these forums and i was just wandering if there are any guys or gals out there who
    wanna start making an fps in their spare time as part of a team. idealy i would love the project to
    get to the point of mmo but hey! and im easy on the dev language and any engines that may be
    used, getting a few people together to discuss would be great!....
  16. Game Creation
    (26)
    A lot of game creation costs money but there are free ones like the following: RPG Toolkit, Verge,
    Beyond Virtual Starter Kit, Dark GDK Plugin. ....
  17. Game : Mario Forever 4
    (18)
    Publisher : Buziol Game Software www.buziol.pl QUOTE Super Mario Forever is
    really a classic Mario remake. Once again you strap on your wrench and hardhat and guide the chubby
    plumber through many skillfully made levels. The diversity of the levels is very impressive. You
    will have to get through levels ranging from underwater caverns to levels filled with hot lava.
    Version 4 may include unspecified updates, enhancements, or bug fixes. Click here to download
    ....
  18. Cute Knight Review
    Girly-styled game that's really for all RPG fans (3)
    When most Western people think of consol RPGs, they generally think quests, fighting monsters, and
    set story lines. This makes games that explore the ROLE playing elements of RPGs all the more
    refreshing when they come along. Cute Knight is a game by Hanako Games , who's mission
    statement includes " girl games with unicorns instead of prom dresses ". Despite the distinctly
    feminine feel of most of their games, however, their depth and innovation can appeal to everyone.
    Cute Knight is their most recent, and best, installment. Where to find: A trial version of Cu....
  19. Trouble With Rpgmaker Xp
    (19)
    I newly installed RPG Maker XP and a message pops up saying. "Failed to obtain a trial activation
    code from the nTitles server!" Now what do I do?....
  20. Bloobs
    Fun puzzle type shooting game (5)
    Anyone heard of Bloobs ? You shoot pieces called Bloobs to form 3 bloobs. Then it clears the
    pieces. You do this until all bloobs clear off the screen. It is fun and mildly addictive. I am
    writing a guide for this game, so people can become more aware of it and play better. /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Try it and see. NOTICE: The
    page may not display properly in Opera. It will display in Avant Browser, Netscape, IE, Maxthon and
    Mozilla/SeaMonkey.....
  21. Driver!
    That oldschool Driver1 game! (18)
    Has anyone played Driver 1? They have Driv3r now, and it's not too great... but when Driver
    first came out it was an awesome driving game. Has anyone played it? I still have my copy, and
    play it every once and a while.....
  22. Animaro Free Mmorpg Game!
    (7)
    AnimaRO:: Free Massive 3D Multiplayer Game www.animaro.com AnimaRO is the best server out
    there! why? ~5x/5x/5x rates! ~We NEVER wipe characters ~Custom Npcs ~Friendly Community
    ~Very friendly staff There's more! XD go to www.animaro.com and try for yourself you
    won't regret it. It's free and easy to play with a very stable server and amazing graphics
    /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> If are any
    questions about this server I'll be happy to answer them here. /biggrin.gif" sty....
  23. Are You Part Of The 2% Or The 98%?
    mind guessing game (18)
    2% or 98% of Population?Just follow these instructions, and answer the questions one at a time and
    as quickly as you can! Again, as quickly as you can but don't advance until you've done
    each of them .... really. Now, scroll down (but not too fast, you might miss something). THINK of
    a number from 1 to 10 MULTIPLY that number by 9 If the number is a 2-digit number, ADD the
    digits together Now SUBTRACT 5 DETERMINE which letter in the alphabet corresponds to the
    number you ended up with (example: 1=a, 2=b, 3=c,etc.) THINK of a country that....
  24. Favourite Final Fantasy Game
    YOUR FAVOURITE FINAL FANTASY GAME (16)
    Mine's Final Fantasy X. Tidus is the best character ever. And Blitzball ROCKS!!!....
  25. Worst Game Of All Time
    wats the baddest game of all time (60)
    I think the worst game of all time is superman for the nintendo 64 it was so stupid u had to fly
    around these rings in the first mission which made no sense the game itself was poorly done the
    powers were the only good thing and the story made no sense wat so ever so tell me wat u think is
    the worst game of all time and why....
  26. Opengl And Mfc Dialog Based Application
    some comments about using it together (7)
    AS you probably know you can create a simple OpenGL applications using WinAPI functionality only
    (you can create it using Microsoft Visual Studio), but if you are making somethink with real windows
    interface and want to create application with multiple windows/dialogs/buttons with Windows Styles
    etc... you can use MFC (Microsoft Foundation Classes) to do it ... But i did a 2 hours web search to
    find example of using OpenGL windows inside MFC created Dialog window. I found it and want to share
    my results now. My application is a simple OpenGL based tool, which shows Ope....
  27. Resident Evil 4
    comments about this grat game (24)
    Hi!!! for me this is the best game ever!!! ... graphics, sound, the style
    of play ... in gamespot the rate the game 9.6 of 10!!! thats great!!! if
    you dont know anything about this games enter here
    http://www.gamespot.com/gamecube/adventure...il4/review.html check the reviews and the
    images!!! are great!!!! i want to read your comments about this
    game!!! and if you think that the story stills have relation or it is only a patch like
    many others come on !! POST!....
  28. What's Your Favorite Game System - Console
    select one from each poll (175)
    i'm a computer game fan. it's expensive but more useful. it can be use for many purpose for
    your study and entertainment. much easier to use and most common to more people.....
  29. Americas Army
    The best game ever (46)
    Americas army is awesome, its free and the game play is great. Its released by the US army, and the
    graphics are hecka good. Right now it has a few glitches, but the next patch should fix that. If u
    havent tried it already, I suggest u should!....
  30. Game Maker
    (62)
    This is one of the best free Game-making programs on the internet. It it an outstanding program with
    easy-to-use tools for beginners, and a solid flexible programming Language for advanced users.
    I've been using this program for over a year now, and I must say that it is amazing. It may not
    be as good as OpenGL C++, but it's still worth the download. You can also register if you want
    to use some of the more advanced functions, such as Multiplayer functions, DLL manipulation, and
    such. If you would like to take a look at this program, click on the link below: h....

    1. Looking for opengl, matrix, translation, issues, trouble, 3d, game

Searching Video's for opengl, matrix, translation, issues, trouble, 3d, game
advertisement



Opengl Matrix Translation Issues - having trouble with my 3D game.



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE