Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9195881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:43:36+00:00 2026-06-17T21:43:36+00:00

As it stands, I have a map with roads on it and vehicles are

  • 0

As it stands, I have a map with roads on it and vehicles are able to drive back and forth from south to north and east to west (and opposite ways as well). I have used JPanels thus far to represent the vehicles. However now it’s becoming a bit difficult to handle because I want to turn the vehicles at junctions and smooth lane changing etc.

So it doesn’t seem like JPanel is the optimal choice for this. What I’ve tried so far is to use the Shape interface to draw polygons and use these as vehicles, however I’m not sure that this is the right choice.

I will eventually want to construct my own vehicle image so the solution will have to either be able to add the image as it’s background or something similar and still be able to perform operations such as rotation, transformation etc.

Any guidance on this will be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:43:38+00:00Added an answer on June 17, 2026 at 9:43 pm

    Personally, using JPanel isn’t a bad choice, what you need to be able to do is extend it’s capabilities to allow you to paint changes in orientation of the vehicle as it turns.

    This is going to require some animation – you going to want to know how long it would take a vehicle to complete a turn so you can calculate the angel of the vehicle over time.

    For this, I would be using AffineTransformation, check here for some examples.

    You will also need to change the size of the component as the vehicle turns, check here for the answer.

    Lane changes would be a similar (if easier) concept. The basic idea would be to have a start position and end position of the translation and move to that position over time. Again, you would need to know the amount of time it would take to complete the translation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I am writing an app in Twisted, and as it stands I have
I have been optimizing my website but the one problem that stands in my
As it stands, I have a deserialiser that can import any model I throw
I have got Foo <=> FooGroup <=> Bar relation, where <=> stands for ManyToMany
I'm back with more work on the Google Map that I've been working on.
Suppose I have this base class: struct Vehicle { //op stands for the operator
I have the following code: @profile.update_attributes(params[:xxxx_profile]) where xxxx stands for either male or female.
As it stands, I have some JQuery along these lines - ph=function(i){ $.each(i,function(po){ id=po.id;url=/+id;t=$('<div
I have the following structure of spring context files ( -> stands for 'includes')
I have a little problem with an AJAX function: PAGE A stands for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.