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.

DarkBASIC Professional Discussion / Movement/Texture problem .

Author
Message
Keemo1000
20
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 21st Oct 2005 12:57
Ive made my main character in the game a sphere (make object sphere). After ive made a texture for it , and textured the sphere , it looked pretty well. When i started coding movement , and tested the program , i found that when the object is supposed to move forward , it moves right , obviously ,the object is really moving forward , but the texture placement makes it look like its moving right , so if you can help me position the texture in some way or other , please reply about it .

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Oct 2005 13:05
Spheres are weird, textured spheres have the texture wrapped around the sides, so the tops and bottoms tend to look a little strange - really it depends on how you want the sphere to move, but you could rotate it 90 degrees on the X axis, like:

ROTATE OBJECT Obj,90,0,0 : FIX OBJECT PIVOT Obj

That would turn it on it's side. If you'd like to make the sphere roll around, then you should look into the freeflight commands, like PITCH OBJECT UP and ROLL OBJECT LEFT, like depending on how much it has moved on each axis. You can't really use the ROTATE OBJECT command to roll a sphere around, it's quite tricky really.


Van-B

Put those fiery biscuits away!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Oct 2005 14:10
A while ago we had all sorts of fun trying to write a marble madness type game but you will never get texture rotating correctly on a sphere because of the way DBPro rotates objects.

Easy way out is to downnload EZrotate dll - there is a cutdown free version around somewhere that will allow you to rotate objects in all sorts of different ways, one of which is ideal for what you want. Try this code after you have installed the dll;



Boo!
Keemo1000
20
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 21st Oct 2005 15:18
By the way , the sphere isnt supposed to roll , its supposed to be moving forward normally , as if its gliding . But it wont roll around like a ball .

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Oct 2005 15:44
Perhaps a plain map on the sphere would be better, that would involve using a seperate object, but if your drawing the texture yourself then someone should be able to knock out a custom sphere for you.

For instance, if you wanted to make a pac-man, you could plain map the sphere and just draw a mouth and eye on the texture.


Van-B

Put those fiery biscuits away!
Keemo1000
20
Years of Service
User Offline
Joined: 26th May 2005
Location: 28th Dimension
Posted: 21st Oct 2005 15:44
Quote: "ROTATE OBJECT Obj,90,0,0 : FIX OBJECT PIVOT Obj"


Wow thanks ! ROTATE OBJECT Obj,90,0,0 : FIX OBJECT PIVOT Obj gets my model on his side , but FIX OBJECT PIVOT Obj FIXes the problem !

thanks again

Login to post a reply

Server time is: 2025-06-05 19:09:21
Your offset time is: 2025-06-05 19:09:21