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.

DarkBASIC Discussion / Center of object mass

Author
Message
John H
Retired Moderator
23
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Mar 2003 04:49
Yep I have a question

For our RPGs magic system, I am using a textured cone rotating on the Y axis to achieve the affect of a small magic effect around the characters feet.

I made a simple model of a cone in milkshape, and assigned it a very basic texture. It is set up like 4 checkers squares, each color has a match in the opposite corner. The bottom of the cone is texture black so I can make it transparent when the magic effect is taking place (other places will be transparent as well )

Now, I have my very basic code to get the job done,



And for those who cand see it

`load my object
load object "magicconewithtexture.x",1
load image "magicconerevised.bmp",1

`texture the object
texture object 1,1

`rotate so i can see the bottom
xrotate object 1,180

`now set the object so no black shows
set object 1,1,0,1,1,1,1,1

`now rotate
do
while keystate(24)=0
for x=1 to 360
yrotate object 1,x
next x
endwhile
loop

Yes that code isnt good but its just to test out the effect. Now, the weird part is, I think I screwed up with the center of the mass. YROTATE OBJECT rotates the object from the center of the mass. Whereas on this model, the desired center is the point of the cylinder, which will be under the matrix.

Now, to my dismay, I found that the objects center of mass is ACTUALLY on the side of it. Is there a way to code around this, and does anyone know a way to find the center of the object (and set the center of mass) in milkshape? I have tried coding around it, but I didnt get it. I am expecting that there is a way to do it with milkshape, anyone know how?

Thanks in advance,
RPGamer
Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
John H
Retired Moderator
23
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Mar 2003 05:01
Well never mind guys I figured it out I had it positioned off center in milkshape, I knew it was something to do with that! When I opened milkshape I saw that the side of my cone was on the edge of the y axis, so I just moved it so the point was aligned on it and WHAM it worked These silly late night problems

Later
RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
John H
Retired Moderator
23
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Mar 2003 05:02
Yahoo! Record time solving my own idiocy! 12 minutes boo ya!

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!

Login to post a reply

Server time is: 2026-06-12 03:34:49
Your offset time is: 2026-06-12 03:34:49