Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Camera Question
Old
thetrippster
Guest
 
Status:
Posts: n/a
Default Camera Question - 10-06-2006, 08:30 AM

Is there any way to have a camera follow a object with out setting its vehicle propety? like right now in my class i have to make a skate board scene and i want the camera to follow the board but when the board spins i dont want the camera to spin with it.
   
Reply With Quote
Some Options
Old
DrJim
Guest
 
Status:
Posts: n/a
Lightbulb Some Options - 10-07-2006, 11:39 AM

This has given me some trouble also. The only two options I know are (1) to have the camera track a dummy object (with "isShowing" = false) that is also the vehicle for the moving object and (2) to actually program the motions of the camera independently. The second option, of course, only works if you know beforehand where the moving object is going - it won't work for an interactive program.

The attached world is what I have been using as a test case. Setting both Zen's and the camera's vehicles to the pointer gives fairly good results as does just disabling the entire camera setup block and enabling the camera "move" command in the movement loop. Note that the results are (1) different and (2) depend on the camera's initial position. For both of these test cases, I disabled the "camera constrain ---" instructions; however they didn't, in the test cases I've run, seem to have much effect.

I would really be interested if anyone has different/better solutions.
Attached Files
File Type: a2w cameraTracking.a2w (976.2 KB, 449 views)
   
Reply With Quote
Old
thetrippster
Guest
 
Status:
Posts: n/a
Default 10-09-2006, 08:22 AM

hmm thnx im gonna keep trying to find a way. but your way works fine for now. thnx for the help
   
Reply With Quote
Old
thetrippster
Guest
 
Status:
Posts: n/a
Default 10-09-2006, 08:32 AM

i also have one last question that i didnt get to ask earlier due to class ended. i have placed a ramp infront of my skater but if i tell her to go towards the ramp she passes through it. i coded the j button to make it look like she went up the ramp but it only looks real after the forward button has been pressed twice then j is typed. is there ne way to set up a parameter or vairable to make it when the board reaches the ramp it automatically rolls backward or forward to match the angle of the ramp? instead of simply passing through the ramp. if there is such a way i could greatly reduce my coding and create realistic physics.

all my methods are located under the skate boards methods.

i have attached my project. im srry for the lack of notes but im just starting with this stuff, but the controls are
up arrow key for move forward
left arrow key for left
right arrow for right
and j key simulates the ramp jump
and s spins the char
Attached Files
File Type: a2w project1.a2w (1.18 MB, 443 views)
   
Reply With Quote
Hopefully not your last question.
Old
DrJim
Guest
 
Status:
Posts: n/a
Thumbs up Hopefully not your last question. - 10-09-2006, 10:37 AM

Hopefully the above isn't your last question - the group needs questions like this to keep us thinking.

In this case, you've asked a fairly hard one since it involves collision detection (is the skateboard on the ramp?) and then terrain following (turning the board so it's oriented correctly as it goes up the ramp). I personally haven't done either with Alice.

I suggest you do a key word search of the forum - I know there is quite a bit on "collision" - in fact Mr. Nemo will probably will post something. As far as terrain following goes - I remember one posting but couldn't find it with a quick look and don't think the results were very good. Though they were better than some of the "real world" work - in one of the early tests an F111 followed the terrain perfectly about 10 feet above the surface - fine until it flew over the edge of a mesa in west Texas (the pilot did eject in time).

Jim
   
Reply With Quote
Hrm...
Old
Shadow Sovereign
Guest
 
Status:
Posts: n/a
Default Hrm... - 10-27-2006, 09:17 PM

I know I'm coming into this conversation a little late, but why not take a peek at the example with the interactive plane simulator where you fly thru the rings and all that good stuff. Just take a look at the coding there for the camera. As for the ramp thingumabobber, that's a toughie...

If I find a solution, I'll be sure to post it...... assuming I remember to...
   
Reply With Quote
Old
Kirbya
Guest
 
Status:
Posts: n/a
Default 11-03-2006, 05:12 PM

To answer your first question you could do this.

Right before your skateboard spins set the camera's vehicle to "world", then after the spin occurs set it back to the skateboard.

Hope I helped,
Kirbya
   
Reply With Quote
...Hmm...
Old
Shadow Sovereign
Guest
 
Status:
Posts: n/a
Lightbulb ...Hmm... - 11-03-2006, 08:05 PM

...You know... that actually might work. With the camera set to the world, the camera won't spin with the skater, and voila.
However, I hate to be johnny raincloud here, but then wouldn't the camera be stuck in one place once its set to the world, because then it wouldn't move with the skater, would it?
I suppose an If/Else statement could come in to fix this by identifying if the camera is set to the world, and if it is, the camera could be programmed to follow the skater itself (much like the Flight Simulator example with the rings and all).

I hope I haven't compounded the problem...
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.