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 / Below is the same meaning?

Author
Message
PingXiang
11
Years of Service
User Offline
Joined: 19th May 2013
Location:
Posted: 3rd Jun 2013 15:47
Below is the same meaning?

THE FIRST IS:
result=make vector3(1)
set vector3 to particles position 1, 1
rot#=z vector3(1)
result=delete vector3(1)


THE SECOND IS :
rot#=PARTICLES POSITION Z(1)

A simple problem is complicated?
why?
I am chinese ,English is not too good, sorry.

Chinese
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 4th Jun 2013 02:45
Both of your code snippets will retrieve the same value yes (the Z angle of particle "1").

I am unsure about what you mean with "A simple problem is complicated?" but there are many ways to solve problems in programming.
If you really only need the z angle your second version is obviously better as it is both faster to write and to execute (as it will (most likely at least) result in fewer operations).
Vectors are good since they allow you to perform 3d maths, something which might be of use in a more complex application, so there are uses for that approach too, it depends on what you want to accomplish


"Why do programmers get Halloween and Christmas mixed up?"
PingXiang
11
Years of Service
User Offline
Joined: 19th May 2013
Location:
Posted: 7th Jun 2013 05:36
thanks

Chinese

Login to post a reply

Server time is: 2024-11-23 15:35:33
Your offset time is: 2024-11-23 15:35:33