Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbMakeObject messes up my Z-axis

Author
Message
Lokiii
15
Years of Service
User Offline
Joined: 26th Oct 2008
Location:
Posted: 26th Oct 2008 15:36
Hello everyone!

I've run into a problem. I'm trying to make a game and I spawn four objects right now. The first three are fine and spawn on XYZ 0,0,0. When I do dbMakeObjectSphere for the forth one, it still creates it, but it shifts my whole Z-axis by 50 points. So if previously the origin would be 0,0,0 now it becomes 0,0,-50. I use a rectangle box for the floor, so I don't know if that might be fixed with an actual Terrain or a World. Any ideas how to hardcode my axis or a way around this?

Code:
Main:


Hero Bullet:



Thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Oct 2008 18:40
I don't see an dbAutoCamOff() in there anywhere, so I would guess that the camera is simply being repositioned to view the newly created object.

Lokiii
15
Years of Service
User Offline
Joined: 26th Oct 2008
Location:
Posted: 26th Oct 2008 23:13
Hey IanM,

Putting dbAutoCamOff() did not help.

I'm using this code to convert my screen mouse positions into 3d XYZ coordinates. Is that correct?


How does pickVector and dbPickObject work? Maybe I'm messing them up some how?

Thanks.
Lokiii
15
Years of Service
User Offline
Joined: 26th Oct 2008
Location:
Posted: 27th Oct 2008 16:20


I fixed my problem!

It was actually really simple.

When I was using the dbCameraPositionX() and dbCameraPositionZ() functions, they were getting the value of the origianl camera rather then my new camera 1. So a fix was basicly replacing dbCameraPositionX() with dbCameraPositionX(1) !!!

YAY!

Login to post a reply

Server time is: 2024-09-30 09:19:32
Your offset time is: 2024-09-30 09:19:32