Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what's wrong with transform.translate ?!

Status
Not open for further replies.

Rtype

Technical User
Feb 16, 2003
5
NL
The documentation of Director tells me you can give a {,relativeto} parameter with transform.translate: so this would be correct:
transform.translate(vector(100,10,4),#world)...you'd think.

Well somehow not cus it yells at me that those are the wrong number of parameters

Any ideas would be greatly appreciated
 
transform.translate(vector(100,10,4),#world)
This line is wrong.

You should just write either:
member("theMemberName").model("theModeName").transform.translate(100,10,4)
or
member("theMemberName").model("theModeName").translate(100,10,4).

One of them would be correct.
Hope this helps.




 
I already knew that but I really want to give a relative to with it. tnx anyway
 
Sorry for not reading your message properly...
Anyway, what exactly are you trying to achieve here. Are you trying to move the model using the World Axis. If thats the case, you can use: transform.worldPosition

I do not have Director 8.5 with me right now, but I will go back to check on the {,relativeto} function.

Hope I'm answering your question.
 
Now that's exactly the problem: I do NOT want to translate relative to the #world but relative to another model or #self. If I can't do that I'll have to write code to calculate it myself but that would be a little more work but above all more processing and messier.
 
Ah, I see.
How an object moves is determined by the object's pivot point set in 3D Max. So, if you want to move the model relative to its axis, you can go to the hierarchy panel in 3D Max and align the pivot point to the center of the model. And likewise if you want to move relative to another model.

In other words, it can be said that you have to transform.translate relative to an object's pivot point. Try adjusting the pivot in 3D max to see the result. Also, I think there are functions in Director that deals with the adjustment of pivots.
I will try to look up on them, and you should too.
 
hmm well if I rotate my object with my code doesn't the pivot point rotate also? Sorry but I don't have Director here right now.
 
When you rotate, you are rotating the model around its axis.
So, rotate(1,0,0) is rotating around its x axis, the pivot won't rotate.
Are you making an effect of something orbiting, like the solar system?
If thats the case, your model's pivot point will be set at the Sun,s position.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top