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 / getting the position of my laser beam correct

Author
Message
Spectre 117
14
Years of Service
User Offline
Joined: 18th Apr 2010
Location: *Insert cheesy location here*
Posted: 21st May 2010 05:56
Ok so I am back with a new question about my 3D space shooter. I have made my laser and developed a primitve firing routine. The problem I am having now is getting my laser to appear from a specific position on my space ship and povit toward the target correctly(right now I don't have a target, I am just moving moving the laser using keys). What is happening right now is that the laser is not sticking to the pivot point. When I am firing the laser and rotate it left or right, the laser fires from a location off the ship equal to the limb off set and the degrees turned. For example if I fire the laser and then turn the 3 degrees the laser's origin looks like it moved 3 degrees off the ship since the camera follows the object. If anyone has any ideas that could help I would love to here them. Thanks.
Spectre 117
14
Years of Service
User Offline
Joined: 18th Apr 2010
Location: *Insert cheesy location here*
Posted: 22nd May 2010 02:48 Edited at: 22nd May 2010 04:19
Ok so I guess my last post most have been confusing, which is ok, because I have figured out some of it already. What I hope some one can help me with now is gluing one object to another. Is it possible to glue object 2 to object 1 at a specific location on object 1?
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 22nd May 2010 13:27
I`m quite sure it can, just use some offset to place object 2 just where you want it.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Spectre 117
14
Years of Service
User Offline
Joined: 18th Apr 2010
Location: *Insert cheesy location here*
Posted: 22nd May 2010 16:22 Edited at: 22nd May 2010 17:17
yeah that is the way I am doing now. I think the real problem is that in DBpro objects are positioned and moved from their center point, while in this case I need object to be moved and rotated by one of its ends (since I am dealing with a plain in this case). So right now when I off set the laser half is distance and fix its pivot point I know that there are vertex data commands that I think might help me but I don't know how to use them. I did made a little example in paint to show everyone what is happening. Its not a great picture but I think it will do the job.

edit: took a screen shot an edited to show what is happening and what I want

Attachments

Login to view attachments
zootan
14
Years of Service
User Offline
Joined: 12th Apr 2010
Location:
Posted: 25th May 2010 19:08 Edited at: 25th May 2010 19:48
if you can edit the model (in 3d editing software) you can create a named limb or face of the model then check for the limb/area in the model in your db program . I think this way , if u can do it, is easier to position things exactly where u want.
edit ,also so u made the plane in the db prog... and it sticks it on the position from half way down the plane , easy to rectify , make the plane in 3d software allign it corrctly so it starts at 0 point. then it will be perfect when u load and use it in db. I made one and offered it in a recent thread , feel free to look for refrence or use that one , hold on ill attach it here too

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 25th May 2010 21:19 Edited at: 25th May 2010 21:22
Quote: "What is happening right now is that the laser is not sticking to the pivot point. When I am firing the laser and rotate it left or right, the laser fires from a location off the ship equal to the limb off set and the degrees turned."


Does your model indeed have limbs? If you don't know, you can run this code:

and then print out the value to see how many limbs there are. You could very easily place a sphere at the limb locations (start at limb 3) so that you can visually see where they are. To get the actual limb locations, use LIMBPOSX# = LIMB POSITION X(ObjectNumber,LimbNumber) - same for Y and Z positions. If you have 3D modeling software, you could easily create a limb where you want the object to fire from (it should be the child of the root limb). you could place your laser beam there and angle it according to the limb's angle and simply move it from there. If you don't have 3D modeling software, you could email me the model and I will be glad to do it for you.

Quote: "What I hope some one can help me with now is gluing one object to another. Is it possible to glue object 2 to object 1 at a specific location on object 1? "


You really wouldn't want to glue the laser beam to a limb, as you need to move it. If you really wanted to, look up the GLUE OBJECT TO LIMB command. Beware, the object being glued takes on the scale of the main object. If you scale the original object to 500,500,500, your glued object will be 5X normal size (I learned this the hard way). The glued object is held at the position of the limb that it was glued to. You could offset the limb to move it, but I really don't think you need to go there.

Hope this helps.
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 25th May 2010 21:22
Actually zootan proposal is better.Just grab some editor and make a limb or few if you need more.Save it and use the limbs for more acurate and easy positioning.Most games use that method.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Spectre 117
14
Years of Service
User Offline
Joined: 18th Apr 2010
Location: *Insert cheesy location here*
Posted: 26th May 2010 06:04
Thanks for the replies everyone. I already decided to make a simple plain in the 3d editor that I have. So that was simple enough. I would simply add the limb to my space craft in the editor by making it a limb, but I don't know how to yet. In fact, if I knew how to make limbs in my editor I would simply attach my turrets to the ship also instead of loading them as a different object. Maybe I will figure out AC3D one day.

Login to post a reply

Server time is: 2024-11-24 15:46:04
Your offset time is: 2024-11-24 15:46:04