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 / A little help with axis rotation problem.

Author
Message
midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 5th Jan 2011 20:51
Sorry to bother you guys once more but i decided to improve http://forum.thegamecreators.com/?m=forum_view&t=45842&b=6this[/href] editor.

I ve added some basic stuff like error corection (it crashed every time you mispelled a model filename),clone object,delete object and planning to add rotation.But i have a begginer problem that i need your help.
When i load a .x model in darkbasic it does not have the same xyz system as 3dsmax for example.So the front view of 3d max is the up view up view for darkbasic.Of course i know how to rotate the model.But in the editor there is some code that confuse me.

ang#=object angle y(object)
yrotate object object,camera angle y():move object object,mousemovey()
yrotate object object,camera angle y()+90:move object object,-mousemovex()
yrotate object object,ang#

This is the code that handles the model after i click on it.While i load the model to face me with the front view when this code kicks in it turns my model to face down.I dont know what to change to keep moving my model in the x and z axis.After this code it moves in the y and z axis.

Well i am impatient i guess or lazy to figure out that the model has its own axxis system and i need to correct the above code.

Anyway if someone got it and would like to help me plz post your answer.The full source is attached.Thank you.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 6th Jan 2011 15:10
It is better to use the CODE tags and put code in a snippet than it is to upload a file. Click the CODE button, paste your code, and click the CODE button again. Actually, the code is a little corrupted and some subroutines are missing from it.

You might check out the
command.

Quote: "
I dont know what to change to keep moving my model in the x and z axis.After this code it moves in the y and z axis."

Check out the NEWXVALUE and NEWZVALUE commands. They are great for calculating movement.

One other thing; I would use WRAPVALUE when adding to an angle, like this:


That way, the angle will never get outside of the 0 to 360 degree range.

midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 7th Jan 2011 02:10
I uploaded two files.So the missing subs must be in the lib.dba.Anyway thanks once more lbfn

Login to post a reply

Server time is: 2024-09-29 00:32:53
Your offset time is: 2024-09-29 00:32:53