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.

Dark GDK / 3rd person style camera.

Author
Message
The Guru
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 9th Feb 2008 18:34
Hello,

I am trying to "attach" a model in front of the camera so the model becomes a character and can move through the landscape. the code below is from the sample files which i am modifying.



and

void dbLoadObject ("media\\model.3ds", 1 ) // Load the model

Could someone help me attach the model to the camera?

Thanks,
The Guru
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 9th Feb 2008 19:41
This is how i have loaded the model so far. -

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 9th Feb 2008 20:02 Edited at: 9th Feb 2008 20:07
Move the camera by a positive amount
position your model at the camera's x,y & z coordinates
Move the camera by a negative amount

It's crude but simple and effective

edit **
you may also need to adjust the model's orientation

dbSetObjectToCameraOrientation(objectid)

**

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
The Guru
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location:
Posted: 9th Feb 2008 21:07
Thanks,

So far, the model is loaded. But the camera just walks around it. I'm not sure how "attach" it.

This is what i have got so far. ( i modified the terrain sample Demo.cpp) -



The userInput function controls the camera, but when i put the model code in there, the frame rate plummets.

Code you show me the correct location to put the code?

Thanks,

Login to post a reply

Server time is: 2024-11-20 01:25:00
Your offset time is: 2024-11-20 01:25:00