Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Broken RotatePivot()
Broken RotatePivot()
2003-03-23, 8:55 AM #1
Right, so I decided to dig up this stale Space Noxx II level that I never finished, and I'm trying to attach my sun light to my skybox in some fashion. Actually attaching it didn't make it rotate around the pivot point of the skybox, so I tried RotatePivot() instead. It doesn't work either... My template is basically a ghost with light and 0x1 thingflags, and move=path as well as the needed frames.

Inside the pulse, the position of the sun is printed out, but it never changes (which is clearly visible while playing).

Code:
# Jedi Knight COG Script
#
# SunAttach.COG
#
# Created by Emon. E-Mail: emon1337@yahoo.com - ICQ: 35960628
# Feel free to use this COG as long as credit is given in the readme file.
#
# Originally attached sun to starbox, discarded in favor of pivot rotation.
# 
#
# This COG is not supported by LucasArts Entertainment Co.

symbols

thing        Sun
flex	     RotateTime

message      startup                                                         
message	     pulse

end                                                                           

# ========================================================================================

code

startup:

	SetPulse(RotateTime);
	Return;

pulse:

	PrintVector(GetThingPos(Sun));
	RotatePivot(Sun, 0, RotateTime);
	Return;
end


What could be wrong?

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-03-23, 10:18 AM #2
RotatePivot(); will rotate the sun around its own pivot, not around something else's.

Also, the move should be move=physics unless you are going to use frames to move it, which would be a lot easier IMO. Also the tpye=weapon should be used if you want to set the velocity or use ApplyForce() and have it use relative axis instead of world axis.

------------------
I'm just an old man with a skooma problem.
I'm just an old man with a skooma problem.
2003-03-23, 10:56 AM #3
No, RotatePivot() rotates around a frame in the object, which you specify. I got it working, since before I didn't realize you needed to specify PYR in the frame for it to work. Only trouble now is getting it to match up with the sun in my skybox.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-03-23, 11:28 AM #4
Attachthingtothingex(Sun, Skybox, 0xE);

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

[This message has been edited by GBK (edited March 23, 2003).]
And when the moment is right, I'm gonna fly a kite.
2003-03-23, 4:21 PM #5
I did that, GBK, it didn't work. It does not make the sun light pivot around the center of the skybox, and that pivot is in a totally different area of the map.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2003-03-23, 4:27 PM #6
Well I converted my skybox to a skysphere (made in 3ds max by spherizing the textured cube, no distortions or misalignments at all), or more specifically, a starsphere. Not only does it look much better, but aligning the light is much easier.

Then I realized a few minutes before posting this that instead of trying to find the proper values for RotatePivot() (for the frame that specifies pivot) to match up with the (2/4/6) angvel on my starsphere ((2/4/6) wasn't the same for the frame on the RotatePivot()), I can simply use another RotatePivot() on my starsphere, and once I find good values for that, I'll just use them on the moving light. [http://forums.massassi.net/html/redface.gif]

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.
Bassoon, n. A brazen instrument into which a fool blows out his brains.

↑ Up to the top!