School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,116 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,999 people online right now. Registration is fast and FREE... Join Now!




Object not pointing correclty

 

Object not pointing correclty, I'm confused....

hawksprite

2 Nov, 2009 - 03:02 PM
Post #1

New D.I.C Head
*

Joined: 11 Sep, 2009
Posts: 16

I have a problem where enemy models won't face the right direction. I have tried rotating them, with no avail, and i also had no luck rotating what they were pointing at.

The code i used to point them at the object is as follows
CODE

dbPointObject (1,dbObjectPositionX(2),dbObjectPositionY(2),dbObjectPositionZ(2));
dbMoveObject (2,1.0f);


This will move the object in the write direction just fine. But the sprite itself is facing the wrong direction. This code is in the While loop. As i said before i have tried rotating object 1 and object 2 but it didnt seem to change anything.

Much help appreciated.

User is offlineProfile CardPM
+Quote Post


stayscrisp

RE: Object Not Pointing Correclty

3 Nov, 2009 - 03:23 AM
Post #2

Mouth->Insert(Foot);
Group Icon

Joined: 14 Feb, 2008
Posts: 1,404



Thanked: 53 times
Dream Kudos: 300
My Contributions
Does the object rotate at all? or will it only move in the direction you point it at?
User is offlineProfile CardPM
+Quote Post

hawksprite

RE: Object Not Pointing Correclty

3 Nov, 2009 - 07:06 AM
Post #3

New D.I.C Head
*

Joined: 11 Sep, 2009
Posts: 16

QUOTE(stayscrisp @ 3 Nov, 2009 - 03:23 AM) *

Does the object rotate at all? or will it only move in the direction you point it at?


The Object doesnt seem to rotate. I've tried to get it to rotate but it only point in the wrong direction.
User is offlineProfile CardPM
+Quote Post

Aeternalis

RE: Object Not Pointing Correclty

3 Nov, 2009 - 10:31 AM
Post #4

D.I.C Regular
***

Joined: 13 Jul, 2009
Posts: 273



Thanked: 25 times
My Contributions
Reread his post..

Stayscrisp is asking if the object will rotate.. not point at a specific direction but just rotate around in a circle. Can you get the object to physically change which way it is facing?

Also a separate question you need to answer:
Does the object ONLY move in the direction it is facing? Assuming you can rotate it, does it then move in the same direction as before? Or did the rotation change which way it moves...


What language is that?

Aet

User is offlineProfile CardPM
+Quote Post

stayscrisp

RE: Object Not Pointing Correclty

3 Nov, 2009 - 02:46 PM
Post #5

Mouth->Insert(Foot);
Group Icon

Joined: 14 Feb, 2008
Posts: 1,404



Thanked: 53 times
Dream Kudos: 300
My Contributions
The language he is using is Dark Basic

This is a good place to start with some vector mathematics smile.gif http://www.euclideanspace.com/maths/algebr...ookat/index.htm

Its hard going though, but don't get overwhelmed, just read it over a few times.

If you want something easier though, there are rotation libraries that plug directly into DarkGDK

like this
http://gdk.thegamecreators.com/?f=ezrotate

But where's the fun in that tongue.gif

Good luck.
User is offlineProfile CardPM
+Quote Post

hawksprite

RE: Object Not Pointing Correclty

3 Nov, 2009 - 03:48 PM
Post #6

New D.I.C Head
*

Joined: 11 Sep, 2009
Posts: 16

I see what he's asking now. Yes i can make it rotate, but when i do it does not move in the correct direction. It is infact DarkGDK ( DarkBasic is very similar) and i will look into the links you provided when i get a chance. Thanks!
User is offlineProfile CardPM
+Quote Post

stayscrisp

RE: Object Not Pointing Correclty

3 Nov, 2009 - 04:34 PM
Post #7

Mouth->Insert(Foot);
Group Icon

Joined: 14 Feb, 2008
Posts: 1,404



Thanked: 53 times
Dream Kudos: 300
My Contributions
I just thought of something, when I was using Irrlicht one time the math was correct and the model rotated but wouldn't move in the correct direction, it actually had something to do with the model itself and the way it had been rotated before being exported.

That may help you if you can get it into a 3d Model program and rotate it to a different facing direction.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 01:28PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month