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.

Newcomers DBPro Corner / DBPro 3D Object commands not working

Author
Message
Katyman
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 5th Oct 2012
Location: Katy, Texas USA
Posted: 6th Nov 2015 01:03
Well I am stumped on this problem. I have an .X Object (Cyclops) that will not face the camera even though all my other objects work just fine.

Here is the code:


When the object becomes visible, it's back is facing me, thus the YROTATE OBJECT 180. If I approach the object head on then no problem, but if I approach the object from the side, well look at the photo I included. The subroutine RotateD does not effect the object at all and it just will not face the camera.
Any suggestions on how to correct this problem?
When old programmers die...do they decompile?

Attachments

Login to view attachments
29 games
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 7th Nov 2015 21:53
Why are you rotating the RoamNum object and then pointing in at Px#,Py#,Pz#? The point command is overriding the rotate command. Try swapping them over, so point the object first then rotate it 180 degrees.

Unfortunately I can't really tell what's going on in the code snippet - I'm guessing that Px#,Py#,Pz# is the position of the player and X1,Y1,Z1 is the position of the Cyclops - and there's always the possibility that the problem is somewhere else in the code.
Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th Nov 2015 17:21
Perhaps you need to FIX OBJECT PIVOT on your RoamNum object after you initially rotate it 180 degrees. You only would need to do this one time and it would not need to be in the subroutine (i.e. do it early in the code).
So many games to code.....so little time.
Katyman
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 5th Oct 2012
Location: Katy, Texas USA
Posted: 10th Nov 2015 10:18
Sorry I have not been able to get back with everyone I've been in the hospital but I'll be home soon and back to coding I understand what you're saying on many of the issues you pointed out I'm just trying to understand why it went if I point the object towards the camera It refuses to point or face the camera but as soon as I get home I will take your consideration and try a few other things and keep you posted thank you for replying
Don't call me handsome....Just say I am Visually Basic.
Katyman
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 5th Oct 2012
Location: Katy, Texas USA
Posted: 10th Nov 2015 10:19
What to answer one question I do the 180° turn over because whenever the object appears it's backwards facing away from the camera do you suggest that I do the Y rotate somewhere before the functions and the subroutines when I create the object ?
Don't call me handsome....Just say I am Visually Basic.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 10th Nov 2015 17:09
If the object is not pointed toward the camera when you use the POINT OBJECT command, it means your initial Y rotation is off. The easiest way to correct this is to simply rotate it (after you load it in) and use FIX OBJECT PIVOT on it. You only need to do this once. The object should then actually point at the camera at that point. If for some reason it doesn't, you would need to rotate it differently before you FIX OBJECT PIVOT.

This can also be corrected by loading it into a modeling program, rotating the object the correct amount and then saving it again. It is easier just to use FIX OBJECT PIVOT.

Hope you feel better soon.
So many games to code.....so little time.
Katyman
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 5th Oct 2012
Location: Katy, Texas USA
Posted: 12th Nov 2015 02:12
Hello!! I am back from my hospital vacation. Thank you! Anyhow I got the object working by removing the YROTATE from anywhere within the FUNCTION ans placed it and FIX OBJECT PIVOT within where the Cyclops is Loaded. Works great!!! Again thanks and I feel better.
Don't call me handsome....Just say I am Visually Basic.

Login to post a reply

Server time is: 2024-11-23 14:49:59
Your offset time is: 2024-11-23 14:49:59